@@ -2082,13 +2082,6 @@ func validateObjectFieldSelector(fs *core.ObjectFieldSelector, expressions *sets
2082
2082
return allErrs
2083
2083
}
2084
2084
2085
- func fsResourceIsEphemeralStorage (resource string ) bool {
2086
- if resource == "limits.ephemeral-storage" || resource == "requests.ephemeral-storage" {
2087
- return true
2088
- }
2089
- return false
2090
- }
2091
-
2092
2085
func validateContainerResourceFieldSelector (fs * core.ResourceFieldSelector , expressions * sets.String , fldPath * field.Path , volume bool ) field.ErrorList {
2093
2086
allErrs := field.ErrorList {}
2094
2087
@@ -4014,7 +4007,7 @@ func ValidateReadOnlyPersistentDisks(volumes []core.Volume, fldPath *field.Path)
4014
4007
vol := & volumes [i ]
4015
4008
idxPath := fldPath .Index (i )
4016
4009
if vol .GCEPersistentDisk != nil {
4017
- if vol .GCEPersistentDisk .ReadOnly == false {
4010
+ if ! vol .GCEPersistentDisk .ReadOnly {
4018
4011
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" ))
4019
4012
}
4020
4013
}
@@ -4360,15 +4353,6 @@ func validateContainerResourceName(value string, fldPath *field.Path) field.Erro
4360
4353
return allErrs
4361
4354
}
4362
4355
4363
- // isLocalStorageResource checks whether the resource is local ephemeral storage
4364
- func isLocalStorageResource (name string ) bool {
4365
- if name == string (core .ResourceEphemeralStorage ) || name == string (core .ResourceRequestsEphemeralStorage ) ||
4366
- name == string (core .ResourceLimitsEphemeralStorage ) {
4367
- return true
4368
- }
4369
- return false
4370
- }
4371
-
4372
4356
// Validate resource names that can go in a resource quota
4373
4357
// Refer to docs/design/resources.md for more details.
4374
4358
func ValidateResourceQuotaResourceName (value string , fldPath * field.Path ) field.ErrorList {
@@ -4975,10 +4959,7 @@ func ValidateNamespace(namespace *core.Namespace) field.ErrorList {
4975
4959
// Validate finalizer names
4976
4960
func validateFinalizerName (stringValue string , fldPath * field.Path ) field.ErrorList {
4977
4961
allErrs := apimachineryvalidation .ValidateFinalizerName (stringValue , fldPath )
4978
- for _ , err := range validateKubeFinalizerName (stringValue , fldPath ) {
4979
- allErrs = append (allErrs , err )
4980
- }
4981
-
4962
+ allErrs = append (allErrs , validateKubeFinalizerName (stringValue , fldPath )... )
4982
4963
return allErrs
4983
4964
}
4984
4965
0 commit comments