Merge pull request #51257 from NickrenREN/validation-bugfix

Automatic merge from submit-queue (batch tested with PRs 51038, 50063, 51257, 47171, 51143)

Fix validation return value

Errors returned by some validation functions may be wrong

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #51256


**Release note**:
```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-08-25 12:31:05 -07:00 committed by GitHub
commit cd908f3e59
2 changed files with 5 additions and 3 deletions

View File

@ -207,6 +207,8 @@ var standardResources = sets.NewString(
string(api.ResourcePersistentVolumeClaims), string(api.ResourcePersistentVolumeClaims),
string(api.ResourceStorage), string(api.ResourceStorage),
string(api.ResourceRequestsStorage), string(api.ResourceRequestsStorage),
string(api.ResourceServicesNodePorts),
string(api.ResourceServicesLoadBalancers),
) )
// IsStandardResourceName returns true if the resource is known to the system // IsStandardResourceName returns true if the resource is known to the system

View File

@ -3443,7 +3443,7 @@ func validateResourceName(value string, fldPath *field.Path) field.ErrorList {
} }
} }
return field.ErrorList{} return allErrs
} }
// Validate container resource name // Validate container resource name
@ -3456,7 +3456,7 @@ func validateContainerResourceName(value string, fldPath *field.Path) field.Erro
return append(allErrs, field.Invalid(fldPath, value, "must be a standard resource for containers")) return append(allErrs, field.Invalid(fldPath, value, "must be a standard resource for containers"))
} }
} }
return field.ErrorList{} return allErrs
} }
// Validate resource names that can go in a resource quota // Validate resource names that can go in a resource quota
@ -3468,7 +3468,7 @@ func ValidateResourceQuotaResourceName(value string, fldPath *field.Path) field.
return append(allErrs, field.Invalid(fldPath, value, isInvalidQuotaResource)) return append(allErrs, field.Invalid(fldPath, value, isInvalidQuotaResource))
} }
} }
return field.ErrorList{} return allErrs
} }
// Validate limit range types // Validate limit range types