Skip to content
Permalink
Browse files

Merge pull request #73877 from droslean/nits

apis:core:validation: remove unused, changes to idiomatic go
  • Loading branch information...
k8s-ci-robot committed Feb 11, 2019
2 parents 6912bbb + c7e103f commit f7c4389b793cd6cf0de8d67f2c5db28b3985ad59
Showing with 2 additions and 21 deletions.
  1. +2 −21 pkg/apis/core/validation/validation.go
@@ -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
}

0 comments on commit f7c4389

Please sign in to comment.
You can’t perform that action at this time.