diff --git a/test/e2e/framework/BUILD b/test/e2e/framework/BUILD index 00326a0583f..d46e7c3b962 100644 --- a/test/e2e/framework/BUILD +++ b/test/e2e/framework/BUILD @@ -30,7 +30,6 @@ go_library( "//pkg/kubelet/apis/stats/v1alpha1:go_default_library", "//pkg/kubelet/events:go_default_library", "//pkg/kubelet/sysctl:go_default_library", - "//pkg/util/taints:go_default_library", "//staging/src/k8s.io/api/apps/v1:go_default_library", "//staging/src/k8s.io/api/core/v1:go_default_library", "//staging/src/k8s.io/api/policy/v1beta1:go_default_library", diff --git a/test/e2e/framework/util.go b/test/e2e/framework/util.go index 13e8cc80a1b..9ae7f048e0e 100644 --- a/test/e2e/framework/util.go +++ b/test/e2e/framework/util.go @@ -63,7 +63,6 @@ import ( watchtools "k8s.io/client-go/tools/watch" podutil "k8s.io/kubernetes/pkg/api/v1/pod" "k8s.io/kubernetes/pkg/controller" - taintutils "k8s.io/kubernetes/pkg/util/taints" testutils "k8s.io/kubernetes/test/utils" imageutils "k8s.io/kubernetes/test/utils/image" uexec "k8s.io/utils/exec" @@ -1008,7 +1007,7 @@ func verifyThatTaintIsGone(c clientset.Interface, nodeName string, taint *v1.Tai ginkgo.By("verifying the node doesn't have the taint " + taint.ToString()) nodeUpdated, err := c.CoreV1().Nodes().Get(context.TODO(), nodeName, metav1.GetOptions{}) ExpectNoError(err) - if taintutils.TaintExists(nodeUpdated.Spec.Taints, taint) { + if taintExists(nodeUpdated.Spec.Taints, taint) { Failf("Failed removing taint " + taint.ToString() + " of the node " + nodeName) } } @@ -1031,7 +1030,7 @@ func NodeHasTaint(c clientset.Interface, nodeName string, taint *v1.Taint) (bool nodeTaints := node.Spec.Taints - if len(nodeTaints) == 0 || !taintutils.TaintExists(nodeTaints, taint) { + if len(nodeTaints) == 0 || !taintExists(nodeTaints, taint) { return false, nil } return true, nil @@ -1361,3 +1360,13 @@ func PrettyPrintJSON(metrics interface{}) string { } return string(formatted.Bytes()) } + +// taintExists checks if the given taint exists in list of taints. Returns true if exists false otherwise. +func taintExists(taints []v1.Taint, taintToFind *v1.Taint) bool { + for _, taint := range taints { + if taint.MatchTaint(taintToFind) { + return true + } + } + return false +}