Skip to content

Commit

Permalink
Merge pull request #533 from openshift-cherrypick-robot/cherry-pick-5…
Browse files Browse the repository at this point in the history
…27-to-release-4.6

[release-4.6] Bug 1918994: Override termination grace period on annotation
  • Loading branch information
openshift-merge-robot committed Feb 26, 2021
2 parents 98e5610 + 3b33277 commit 2f3101c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/kubelet/kuberuntime/kuberuntime_container.go
Expand Up @@ -27,6 +27,7 @@ import (
"path/filepath"
goruntime "runtime"
"sort"
"strconv"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -607,6 +608,11 @@ func (m *kubeGenericRuntimeManager) killContainer(pod *v1.Pod, containerID kubec
gracePeriod = *pod.DeletionGracePeriodSeconds
case pod.Spec.TerminationGracePeriodSeconds != nil:
gracePeriod = *pod.Spec.TerminationGracePeriodSeconds
if annotationGracePeriod, found := pod.ObjectMeta.Annotations["unsupported.do-not-use.openshift.io/override-liveness-grace-period-seconds"]; found {
if val, err := strconv.ParseUint(annotationGracePeriod, 10, 64); err == nil && val > 0 {
gracePeriod = int64(val)
}
}
}

if len(message) == 0 {
Expand Down

0 comments on commit 2f3101c

Please sign in to comment.