This is an automated email from the ASF dual-hosted git repository.

ccondit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-k8shim.git


The following commit(s) were added to refs/heads/master by this push:
     new 89b8304f [YUNIKORN-2771] Optimization: Mark placeholder pods for 
non-graceful termination (#883)
89b8304f is described below

commit 89b8304fb5bcd0665e1bfe26339555e7b1ce27cf
Author: Craig Condit <ccon...@apache.org>
AuthorDate: Fri Jul 26 13:36:57 2024 -0500

    [YUNIKORN-2771] Optimization: Mark placeholder pods for non-graceful 
termination (#883)
    
    Update the Kubernetes pod spec for placeholder pods to set
    TerminationGracePeriodSeconds to 0. This allows the pods to be removed
    immediately when terminated.
    
    Closes: #883
---
 .golangci.yml            |  2 +-
 Makefile                 |  5 +----
 pkg/cache/placeholder.go | 16 +++++++++-------
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/.golangci.yml b/.golangci.yml
index 179df382..9819f608 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -34,7 +34,7 @@ linters-settings:
   goimports:
     local-prefixes: github.com/apache/yunikorn
   govet:
-    check-shadowing: true
+    shadow: true
   goconst:
     min-occurrences: 5
   funlen:
diff --git a/Makefile b/Makefile
index 030a68b1..8d02acc9 100644
--- a/Makefile
+++ b/Makefile
@@ -288,10 +288,7 @@ $(GINKGO_BIN):
 .PHONY: lint
 lint: $(GOLANGCI_LINT_BIN)
        @echo "running golangci-lint"
-       @git symbolic-ref -q HEAD && REV="origin/HEAD" || REV="HEAD^" ; \
-       headSHA=$$(git rev-parse --short=12 $${REV}) ; \
-       echo "checking against commit sha $${headSHA}" ; \
-       "${GOLANGCI_LINT_BIN}" run
+       @"${GOLANGCI_LINT_BIN}" run
 
 # Check scripts
 .PHONY: check_scripts
diff --git a/pkg/cache/placeholder.go b/pkg/cache/placeholder.go
index 8235bf11..d259b562 100644
--- a/pkg/cache/placeholder.go
+++ b/pkg/cache/placeholder.go
@@ -85,6 +85,7 @@ func newPlaceholder(placeholderName string, app *Application, 
taskGroup TaskGrou
 
        // prepare the resource lists
        requests := GetPlaceholderResourceRequests(taskGroup.MinResource)
+       var zeroSeconds int64 = 0
        placeholderPod := &v1.Pod{
                ObjectMeta: metav1.ObjectMeta{
                        Name:      placeholderName,
@@ -113,13 +114,14 @@ func newPlaceholder(placeholderName string, app 
*Application, taskGroup TaskGrou
                                        },
                                },
                        },
-                       RestartPolicy:             
constants.PlaceholderPodRestartPolicy,
-                       SchedulerName:             constants.SchedulerName,
-                       NodeSelector:              taskGroup.NodeSelector,
-                       Tolerations:               taskGroup.Tolerations,
-                       Affinity:                  taskGroup.Affinity,
-                       TopologySpreadConstraints: 
taskGroup.TopologySpreadConstraints,
-                       PriorityClassName:         priorityClassName,
+                       RestartPolicy:                 
constants.PlaceholderPodRestartPolicy,
+                       SchedulerName:                 constants.SchedulerName,
+                       NodeSelector:                  taskGroup.NodeSelector,
+                       Tolerations:                   taskGroup.Tolerations,
+                       Affinity:                      taskGroup.Affinity,
+                       TopologySpreadConstraints:     
taskGroup.TopologySpreadConstraints,
+                       PriorityClassName:             priorityClassName,
+                       TerminationGracePeriodSeconds: &zeroSeconds,
                },
        }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@yunikorn.apache.org
For additional commands, e-mail: issues-h...@yunikorn.apache.org

Reply via email to