unify alias of api errors under pkg and staging

This commit is contained in:
danielqsj
2019-11-12 16:26:59 +08:00
parent fc738cbb1d
commit 5bc0e26c19
23 changed files with 116 additions and 116 deletions

View File

@@ -24,7 +24,7 @@ import (
"sync"
v1 "k8s.io/api/core/v1"
apierrs "k8s.io/apimachinery/pkg/api/errors"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -223,7 +223,7 @@ func (r *VolumeReactor) React(action core.Action) (handled bool, ret runtime.Obj
return true, volume.DeepCopy(), nil
}
klog.V(4).Infof("GetVolume: volume %s not found", name)
return true, nil, apierrs.NewNotFound(action.GetResource().GroupResource(), name)
return true, nil, apierrors.NewNotFound(action.GetResource().GroupResource(), name)
case action.Matches("get", "persistentvolumeclaims"):
name := action.(core.GetAction).GetName()
@@ -233,7 +233,7 @@ func (r *VolumeReactor) React(action core.Action) (handled bool, ret runtime.Obj
return true, claim.DeepCopy(), nil
}
klog.V(4).Infof("GetClaim: claim %s not found", name)
return true, nil, apierrs.NewNotFound(action.GetResource().GroupResource(), name)
return true, nil, apierrors.NewNotFound(action.GetResource().GroupResource(), name)
case action.Matches("delete", "persistentvolumes"):
name := action.(core.DeleteAction).GetName()