mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #46711 from derekwaynecarr/redundant-if-block
Fix cross-build by having active deadline seconds use maxInt32
This commit is contained in:
		@@ -2195,11 +2195,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.MaxInt32 {
 | 
			
		||||
			allErrs = append(allErrs, field.Invalid(fldPath.Child("activeDeadlineSeconds"), value, validation.InclusiveRangeError(1, math.MaxInt32)))
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@@ -2585,8 +2583,8 @@ func ValidatePodUpdate(newPod, oldPod *api.Pod) field.ErrorList {
 | 
			
		||||
	// 2.  from a positive value to a lesser, non-negative value
 | 
			
		||||
	if newPod.Spec.ActiveDeadlineSeconds != nil {
 | 
			
		||||
		newActiveDeadlineSeconds := *newPod.Spec.ActiveDeadlineSeconds
 | 
			
		||||
		if newActiveDeadlineSeconds < 0 || newActiveDeadlineSeconds > math.MaxUint32 {
 | 
			
		||||
			allErrs = append(allErrs, field.Invalid(specPath.Child("activeDeadlineSeconds"), newActiveDeadlineSeconds, validation.InclusiveRangeError(0, math.MaxUint32)))
 | 
			
		||||
		if newActiveDeadlineSeconds < 0 || newActiveDeadlineSeconds > math.MaxInt32 {
 | 
			
		||||
			allErrs = append(allErrs, field.Invalid(specPath.Child("activeDeadlineSeconds"), newActiveDeadlineSeconds, validation.InclusiveRangeError(0, math.MaxInt32)))
 | 
			
		||||
			return allErrs
 | 
			
		||||
		}
 | 
			
		||||
		if oldPod.Spec.ActiveDeadlineSeconds != nil {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user