Skip to content

Commit

Permalink
[YUNIKORN-2817] Pods should be deleted according to podspec (#896)
Browse files Browse the repository at this point in the history
Remove the hardcoded 3s grace period on pod deletions.

Closes: #896

Signed-off-by: Craig Condit <ccondit@apache.org>
  • Loading branch information
zhuqi-lucas authored and craigcondit committed Aug 19, 2024
1 parent dfeee61 commit c740b34
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/client/kubeclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,7 @@ func (nc SchedulerKubeClient) Create(pod *v1.Pod) (*v1.Pod, error) {
}

func (nc SchedulerKubeClient) Delete(pod *v1.Pod) error {
gracefulSeconds := int64(3)
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),
Expand Down

0 comments on commit c740b34

Please sign in to comment.