From 609692cf55b9c2e76f27a99ba92a6fc80631867c Mon Sep 17 00:00:00 2001 From: qzhu Date: Sun, 18 Aug 2024 20:42:20 +0800 Subject: [PATCH] Address new comments --- pkg/client/kubeclient.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pkg/client/kubeclient.go b/pkg/client/kubeclient.go index 231438f0a..6132ab75b 100644 --- a/pkg/client/kubeclient.go +++ b/pkg/client/kubeclient.go @@ -31,7 +31,6 @@ import ( "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/util/retry" - "github.com/apache/yunikorn-k8shim/pkg/common/utils" "github.com/apache/yunikorn-k8shim/pkg/conf" "github.com/apache/yunikorn-k8shim/pkg/log" ) @@ -139,13 +138,7 @@ func (nc SchedulerKubeClient) Create(pod *v1.Pod) (*v1.Pod, error) { } func (nc SchedulerKubeClient) Delete(pod *v1.Pod) error { - gracefulSeconds := int64(3) - if utils.GetPlaceholderFlagFromPodSpec(pod) { - gracefulSeconds = int64(0) - } - if err := nc.clientSet.CoreV1().Pods(pod.Namespace).Delete(context.Background(), pod.Name, apis.DeleteOptions{ - GracePeriodSeconds: &gracefulSeconds, - }); err != nil { + if err := nc.clientSet.CoreV1().Pods(pod.Namespace).Delete(context.Background(), pod.Name, apis.DeleteOptions{}); err != nil { log.Log(log.ShimClient).Warn("failed to delete pod", zap.String("namespace", pod.Namespace), zap.String("podName", pod.Name),