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

@@ -24,7 +24,7 @@ import (
"time"
"k8s.io/api/core/v1"
"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/labels"
"k8s.io/apimachinery/pkg/util/uuid"
@@ -654,7 +654,7 @@ func TestPodOrphaningAndAdoptionWhenLabelsChange(t *testing.T) {
if err != nil {
// If the pod is not found, it means the RC picks the pod for deletion (it is extra)
// Verify there is only one pod in namespace and it has ControllerRef to the RC
if errors.IsNotFound(err) {
if apierrors.IsNotFound(err) {
pods := getPods(t, podClient, labelMap())
if len(pods.Items) != 1 {
return false, fmt.Errorf("Expected 1 pod in current namespace, got %d", len(pods.Items))