mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Add validation for Prober TerminationGracePeriodSeconds
This commit is contained in:
parent
1ff5ae2cb5
commit
e378600c90
@ -2637,6 +2637,9 @@ func validateProbe(probe *core.Probe, fldPath *field.Path) field.ErrorList {
|
||||
allErrs = append(allErrs, ValidateNonnegativeField(int64(probe.PeriodSeconds), fldPath.Child("periodSeconds"))...)
|
||||
allErrs = append(allErrs, ValidateNonnegativeField(int64(probe.SuccessThreshold), fldPath.Child("successThreshold"))...)
|
||||
allErrs = append(allErrs, ValidateNonnegativeField(int64(probe.FailureThreshold), fldPath.Child("failureThreshold"))...)
|
||||
if probe.TerminationGracePeriodSeconds != nil && *probe.TerminationGracePeriodSeconds <= 0 {
|
||||
allErrs = append(allErrs, field.Invalid(fldPath.Child("terminationGracePeriodSeconds"), *probe.TerminationGracePeriodSeconds, "must be greater than 0"))
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user