mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 13:02:14 +00:00
Merge pull request #51257 from NickrenREN/validation-bugfix
Automatic merge from submit-queue (batch tested with PRs 51038, 50063, 51257, 47171, 51143) Fix validation return value Errors returned by some validation functions may be wrong **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #51256 **Release note**: ```release-note NONE ```
This commit is contained in:
commit
cd908f3e59
@ -207,6 +207,8 @@ var standardResources = sets.NewString(
|
|||||||
string(api.ResourcePersistentVolumeClaims),
|
string(api.ResourcePersistentVolumeClaims),
|
||||||
string(api.ResourceStorage),
|
string(api.ResourceStorage),
|
||||||
string(api.ResourceRequestsStorage),
|
string(api.ResourceRequestsStorage),
|
||||||
|
string(api.ResourceServicesNodePorts),
|
||||||
|
string(api.ResourceServicesLoadBalancers),
|
||||||
)
|
)
|
||||||
|
|
||||||
// IsStandardResourceName returns true if the resource is known to the system
|
// IsStandardResourceName returns true if the resource is known to the system
|
||||||
|
@ -3443,7 +3443,7 @@ func validateResourceName(value string, fldPath *field.Path) field.ErrorList {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return field.ErrorList{}
|
return allErrs
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate container resource name
|
// Validate container resource name
|
||||||
@ -3456,7 +3456,7 @@ func validateContainerResourceName(value string, fldPath *field.Path) field.Erro
|
|||||||
return append(allErrs, field.Invalid(fldPath, value, "must be a standard resource for containers"))
|
return append(allErrs, field.Invalid(fldPath, value, "must be a standard resource for containers"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return field.ErrorList{}
|
return allErrs
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate resource names that can go in a resource quota
|
// Validate resource names that can go in a resource quota
|
||||||
@ -3468,7 +3468,7 @@ func ValidateResourceQuotaResourceName(value string, fldPath *field.Path) field.
|
|||||||
return append(allErrs, field.Invalid(fldPath, value, isInvalidQuotaResource))
|
return append(allErrs, field.Invalid(fldPath, value, isInvalidQuotaResource))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return field.ErrorList{}
|
return allErrs
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate limit range types
|
// Validate limit range types
|
||||||
|
Loading…
Reference in New Issue
Block a user