Skip to content

Commit c7e103f

Browse files
committed
apis:core:validation: remove unused, changes to idiomatic go
1 parent a1cc48b commit c7e103f

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

pkg/apis/core/validation/validation.go

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,13 +2082,6 @@ func validateObjectFieldSelector(fs *core.ObjectFieldSelector, expressions *sets
20822082
return allErrs
20832083
}
20842084

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-
20922085
func validateContainerResourceFieldSelector(fs *core.ResourceFieldSelector, expressions *sets.String, fldPath *field.Path, volume bool) field.ErrorList {
20932086
allErrs := field.ErrorList{}
20942087

@@ -4014,7 +4007,7 @@ func ValidateReadOnlyPersistentDisks(volumes []core.Volume, fldPath *field.Path)
40144007
vol := &volumes[i]
40154008
idxPath := fldPath.Index(i)
40164009
if vol.GCEPersistentDisk != nil {
4017-
if vol.GCEPersistentDisk.ReadOnly == false {
4010+
if !vol.GCEPersistentDisk.ReadOnly {
40184011
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"))
40194012
}
40204013
}
@@ -4360,15 +4353,6 @@ func validateContainerResourceName(value string, fldPath *field.Path) field.Erro
43604353
return allErrs
43614354
}
43624355

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-
43724356
// Validate resource names that can go in a resource quota
43734357
// Refer to docs/design/resources.md for more details.
43744358
func ValidateResourceQuotaResourceName(value string, fldPath *field.Path) field.ErrorList {
@@ -4975,10 +4959,7 @@ func ValidateNamespace(namespace *core.Namespace) field.ErrorList {
49754959
// Validate finalizer names
49764960
func validateFinalizerName(stringValue string, fldPath *field.Path) field.ErrorList {
49774961
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)...)
49824963
return allErrs
49834964
}
49844965

0 commit comments

Comments
 (0)