diff --git a/internal/controllers/machine/machine_controller.go b/internal/controllers/machine/machine_controller.go index 80792b534d1e..f8d5cea4830d 100644 --- a/internal/controllers/machine/machine_controller.go +++ b/internal/controllers/machine/machine_controller.go @@ -26,7 +26,6 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/wait" @@ -652,7 +651,7 @@ func SkipFuncGenerator(labelSelector *metav1.LabelSelector) func(pod corev1.Pod) if pod.Labels == nil { return kubedrain.MakePodDeleteStatusOkay() } - if labels.Equals(labelSelector.MatchLabels, pod.ObjectMeta.Labels) { + if HasMatchingLabels(*labelSelector, pod.ObjectMeta.Labels) { return kubedrain.MakePodDeleteStatusSkip() } return kubedrain.MakePodDeleteStatusOkay()