From 0cf3b4c8b6690a8334cef8ece95691e520a686f0 Mon Sep 17 00:00:00 2001 From: arkbriar Date: Fri, 2 Jun 2023 13:45:24 +0800 Subject: [PATCH] Update according to comments. Signed-off-by: arkbriar --- pkg/client/fake/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/client/fake/client.go b/pkg/client/fake/client.go index 44a8d8427b..34c8edd187 100644 --- a/pkg/client/fake/client.go +++ b/pkg/client/fake/client.go @@ -1302,7 +1302,7 @@ func allowsGracefulDelete(gvk schema.GroupVersionKind, obj runtime.Object) bool // If the object is a Pod, it can have the deletionTimestamp set without any finalizers. // This is a special case allowed with graceful deletion. For more details, please see: // https://github.com/kubernetes/kubernetes/blob/7935006af2925dc081605c17fcb5e656cedee286/pkg/registry/core/pod/strategy.go#L163-L194 - if gvk.Group == corev1.GroupName && gvk.Kind == "Pod" && gvk.Version == "v1" { + if gvk == corev1.SchemeGroupVersion.WithKind("Pod") { pod := obj.(*corev1.Pod) // If the pod is not scheduled, it will be deleted immediately. if len(pod.Spec.NodeName) == 0 {