Use errdefs package

This commit is contained in:
Brian Goff
2019-05-20 14:11:13 -07:00
parent b9711abff3
commit 02623170cc
24 changed files with 93 additions and 72 deletions

View File

@@ -19,11 +19,11 @@ import (
"sync"
"time"
"github.com/cpuguy83/strongerrors"
"github.com/gorilla/websocket"
client "github.com/virtual-kubelet/azure-aci/client"
"github.com/virtual-kubelet/azure-aci/client/aci"
"github.com/virtual-kubelet/azure-aci/client/network"
"github.com/virtual-kubelet/virtual-kubelet/errdefs"
"github.com/virtual-kubelet/virtual-kubelet/log"
"github.com/virtual-kubelet/virtual-kubelet/manager"
"github.com/virtual-kubelet/virtual-kubelet/trace"
@@ -777,7 +777,7 @@ func (p *ACIProvider) GetContainerLogs(ctx context.Context, namespace, podName,
}
if cg.Tags["NodeName"] != p.nodeName {
return nil, strongerrors.NotFound(errors.New("got unexpected pod node name"))
return nil, errdefs.NotFound("got unexpected pod node name")
}
// get logs from cg

View File

@@ -3,8 +3,8 @@ package azure
import (
"net/http"
"github.com/cpuguy83/strongerrors"
"github.com/virtual-kubelet/azure-aci/client/api"
"github.com/virtual-kubelet/virtual-kubelet/errdefs"
)
func wrapError(err error) error {
@@ -19,7 +19,7 @@ func wrapError(err error) error {
switch e.StatusCode {
case http.StatusNotFound:
return strongerrors.NotFound(err)
return errdefs.AsNotFound(err)
default:
return err
}