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
|
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 {
|
func validateContainerResourceFieldSelector(fs *core.ResourceFieldSelector, expressions *sets.String, fldPath *field.Path, volume bool) field.ErrorList {
|
||||||
allErrs := field.ErrorList{}
|
allErrs := field.ErrorList{}
|
||||||
|
|
||||||
|
@ -4014,7 +4007,7 @@ func ValidateReadOnlyPersistentDisks(volumes []core.Volume, fldPath *field.Path)
|
||||||
vol := &volumes[i]
|
vol := &volumes[i]
|
||||||
idxPath := fldPath.Index(i)
|
idxPath := fldPath.Index(i)
|
||||||
if vol.GCEPersistentDisk != nil {
|
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"))
|
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
|
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
|
// Validate resource names that can go in a resource quota
|
||||||
// Refer to docs/design/resources.md for more details.
|
// Refer to docs/design/resources.md for more details.
|
||||||
func ValidateResourceQuotaResourceName(value string, fldPath *field.Path) field.ErrorList {
|
func ValidateResourceQuotaResourceName(value string, fldPath *field.Path) field.ErrorList {
|
||||||
|
@ -4975,10 +4959,7 @@ func ValidateNamespace(namespace *core.Namespace) field.ErrorList {
|
||||||
// Validate finalizer names
|
// Validate finalizer names
|
||||||
func validateFinalizerName(stringValue string, fldPath *field.Path) field.ErrorList {
|
func validateFinalizerName(stringValue string, fldPath *field.Path) field.ErrorList {
|
||||||
allErrs := apimachineryvalidation.ValidateFinalizerName(stringValue, fldPath)
|
allErrs := apimachineryvalidation.ValidateFinalizerName(stringValue, fldPath)
|
||||||
for _, err := range validateKubeFinalizerName(stringValue, fldPath) {
|
allErrs = append(allErrs, validateKubeFinalizerName(stringValue, fldPath)...)
|
||||||
allErrs = append(allErrs, err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return allErrs
|
return allErrs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue