From 7a36d34bd5bbff351cc850c3638213ac2516a702 Mon Sep 17 00:00:00 2001 From: Mikhail Scherba Date: Thu, 18 Apr 2024 13:17:40 +0300 Subject: [PATCH] [drain] an additional check for daemonset kind when draining Signed-off-by: Mikhail Scherba --- pkg/controller/drain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controller/drain.go b/pkg/controller/drain.go index 5a4f3f3e1..10bc79dea 100644 --- a/pkg/controller/drain.go +++ b/pkg/controller/drain.go @@ -255,7 +255,7 @@ func (o *DrainOptions) daemonsetFilter(pod api.Pod) (bool, *warning, *fatal) { // management resource - including DaemonSet - is not found). // Such pods will be deleted if --force is used. controllerRef := o.getPodController(pod) - if controllerRef == nil || controllerRef.Kind != "DaemonSet" { + if controllerRef == nil || controllerRef.Kind != "DaemonSet" || (controllerRef.Kind == "DaemonSet" && controllerRef.APIVersion == "apps.kruise.io/v1alpha1") { return true, nil, nil } if !o.IgnoreDaemonsets {