Skip to content

Commit

Permalink
UPSTREAM: <carry>: Override termination grace period on annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
ehashman authored and damemi committed Jul 7, 2021
1 parent deeaaa0 commit 1c655f8
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 1c655f8

Please sign in to comment.