Skip to content

Commit

Permalink
UPSTREAM: <carry>: Override termination grace period on annotation
Browse files Browse the repository at this point in the history
OpenShift-Rebase-Source: c56aa0b
  • Loading branch information
ehashman authored and sanchezl committed Dec 20, 2022
1 parent 8b266b9 commit da7b822
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/kubelet/kuberuntime/kuberuntime_container.go
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,11 @@ func setTerminationGracePeriod(pod *v1.Pod, containerSpec *v1.Container, contain
return *containerSpec.LivenessProbe.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 {
return int64(val)
}
}
return *pod.Spec.TerminationGracePeriodSeconds
}
return gracePeriod
Expand Down

0 comments on commit da7b822

Please sign in to comment.