mirror of https://github.com/k3s-io/k3s
Merge pull request #73877 from droslean/nits
apis:core:validation: remove unused, changes to idiomatic gopull/564/head
commit
f7c4389b79
|
@ -2082,13 +2082,6 @@ func validateObjectFieldSelector(fs *core.ObjectFieldSelector, expressions *sets
|
|||
return allErrs
|
||||
}
|
||||
|
||||
func fsResourceIsEphemeralStorage(resource string) bool {
|
||||
if resource == "limits.ephemeral-storage" || resource == "requests.ephemeral-storage" {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func validateContainerResourceFieldSelector(fs *core.ResourceFieldSelector, expressions *sets.String, fldPath *field.Path, volume bool) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
|
||||
|
@ -4014,7 +4007,7 @@ func ValidateReadOnlyPersistentDisks(volumes []core.Volume, fldPath *field.Path)
|
|||
vol := &volumes[i]
|
||||
idxPath := fldPath.Index(i)
|
||||
if vol.GCEPersistentDisk != nil {
|
||||
if vol.GCEPersistentDisk.ReadOnly == false {
|
||||
if !vol.GCEPersistentDisk.ReadOnly {
|
||||
allErrs = append(allErrs, field.Invalid(idxPath.Child("gcePersistentDisk", "readOnly"), false, "must be true for replicated pods > 1; GCE PD can only be mounted on multiple machines if it is read-only"))
|
||||
}
|
||||
}
|
||||
|
@ -4360,15 +4353,6 @@ func validateContainerResourceName(value string, fldPath *field.Path) field.Erro
|
|||
return allErrs
|
||||
}
|
||||
|
||||
// isLocalStorageResource checks whether the resource is local ephemeral storage
|
||||
func isLocalStorageResource(name string) bool {
|
||||
if name == string(core.ResourceEphemeralStorage) || name == string(core.ResourceRequestsEphemeralStorage) ||
|
||||
name == string(core.ResourceLimitsEphemeralStorage) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Validate resource names that can go in a resource quota
|
||||
// Refer to docs/design/resources.md for more details.
|
||||
func ValidateResourceQuotaResourceName(value string, fldPath *field.Path) field.ErrorList {
|
||||
|
@ -4975,10 +4959,7 @@ func ValidateNamespace(namespace *core.Namespace) field.ErrorList {
|
|||
// Validate finalizer names
|
||||
func validateFinalizerName(stringValue string, fldPath *field.Path) field.ErrorList {
|
||||
allErrs := apimachineryvalidation.ValidateFinalizerName(stringValue, fldPath)
|
||||
for _, err := range validateKubeFinalizerName(stringValue, fldPath) {
|
||||
allErrs = append(allErrs, err)
|
||||
}
|
||||
|
||||
allErrs = append(allErrs, validateKubeFinalizerName(stringValue, fldPath)...)
|
||||
return allErrs
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue