redudant if-block in validation code

pull/6/head
Derek Carr 2017-05-31 12:08:52 -04:00
parent f0962765a7
commit 18bf8f8616
1 changed files with 3 additions and 5 deletions

View File

@ -2190,11 +2190,9 @@ func ValidatePodSpec(spec *api.PodSpec, fldPath *field.Path) field.ErrorList {
}
if spec.ActiveDeadlineSeconds != nil {
if spec.ActiveDeadlineSeconds != nil {
value := *spec.ActiveDeadlineSeconds
if value < 1 || value > math.MaxUint32 {
allErrs = append(allErrs, field.Invalid(fldPath.Child("activeDeadlineSeconds"), value, validation.InclusiveRangeError(1, math.MaxUint32)))
}
value := *spec.ActiveDeadlineSeconds
if value < 1 || value > math.MaxUint32 {
allErrs = append(allErrs, field.Invalid(fldPath.Child("activeDeadlineSeconds"), value, validation.InclusiveRangeError(1, math.MaxUint32)))
}
}