Use errdefs package
This commit is contained in:
@@ -10,8 +10,8 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/cpuguy83/strongerrors"
|
||||
"github.com/cpuguy83/strongerrors/status/ocstatus"
|
||||
"github.com/virtual-kubelet/virtual-kubelet/errdefs"
|
||||
"github.com/virtual-kubelet/virtual-kubelet/log"
|
||||
"github.com/virtual-kubelet/virtual-kubelet/trace"
|
||||
"github.com/virtual-kubelet/virtual-kubelet/vkubelet/api"
|
||||
@@ -189,7 +189,7 @@ func (p *MockProvider) DeletePod(ctx context.Context, pod *v1.Pod) (err error) {
|
||||
}
|
||||
|
||||
if _, exists := p.pods[key]; !exists {
|
||||
return strongerrors.NotFound(fmt.Errorf("pod not found"))
|
||||
return errdefs.NotFound("pod not found")
|
||||
}
|
||||
|
||||
delete(p.pods, key)
|
||||
@@ -218,7 +218,7 @@ func (p *MockProvider) GetPod(ctx context.Context, namespace, name string) (pod
|
||||
if pod, ok := p.pods[key]; ok {
|
||||
return pod, nil
|
||||
}
|
||||
return nil, strongerrors.NotFound(fmt.Errorf("pod \"%s/%s\" is not known to the provider", namespace, name))
|
||||
return nil, errdefs.NotFoundf("pod \"%s/%s\" is not known to the provider", namespace, name)
|
||||
}
|
||||
|
||||
// GetContainerLogs retrieves the logs of a container by name from the provider.
|
||||
|
||||
Reference in New Issue
Block a user