Add Validate in addition to ValidateUpdate to validation for most resources.

This commit is contained in:
Brendan Burns
2015-04-08 20:15:49 -07:00
parent e44ec497ed
commit 5d4f1cf8da
10 changed files with 20 additions and 8 deletions

View File

@@ -1225,6 +1225,7 @@ func validateFinalizerName(stringValue string) errs.ValidationErrorList {
// ValidateNamespaceUpdate tests to make sure a namespace update can be applied.
// newNamespace is updated with fields that cannot be changed
// TODO The syntax here is the reverse of the (old, new) pattern in most other validation. Fix this.
func ValidateNamespaceUpdate(newNamespace *api.Namespace, oldNamespace *api.Namespace) errs.ValidationErrorList {
allErrs := errs.ValidationErrorList{}
allErrs = append(allErrs, ValidateObjectMetaUpdate(&oldNamespace.ObjectMeta, &newNamespace.ObjectMeta).Prefix("metadata")...)