add missing alias of api errors under test

This commit is contained in:
danielqsj
2019-11-12 16:43:58 +08:00
parent 5bc0e26c19
commit 6596a14d39
63 changed files with 221 additions and 223 deletions

View File

@@ -28,7 +28,7 @@ import (
"time"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
@@ -276,7 +276,7 @@ func TestCreateOnApplyFailsWithUID(t *testing.T) {
}`)).
Do().
Get()
if !errors.IsConflict(err) {
if !apierrors.IsConflict(err) {
t.Fatalf("Expected conflict error but got: %v", err)
}
}
@@ -348,7 +348,7 @@ func TestApplyUpdateApplyConflictForced(t *testing.T) {
if err == nil {
t.Fatalf("Expecting to get conflicts when applying object")
}
status, ok := err.(*errors.StatusError)
status, ok := err.(*apierrors.StatusError)
if !ok {
t.Fatalf("Expecting to get conflicts as API error")
}
@@ -849,7 +849,7 @@ func TestApplyFailsWithVersionMismatch(t *testing.T) {
if err == nil {
t.Fatalf("Expecting to get version mismatch when applying object")
}
status, ok := err.(*errors.StatusError)
status, ok := err.(*apierrors.StatusError)
if !ok {
t.Fatalf("Expecting to get version mismatch as API error")
}