Expose new REST strategy methods for Pods

This commit is contained in:
Clayton Coleman
2015-02-11 18:32:54 -05:00
parent a8df434c35
commit abe8adc2e2
4 changed files with 99 additions and 5 deletions

View File

@@ -561,7 +561,8 @@ func ValidatePodSpec(spec *api.PodSpec) errs.ValidationErrorList {
return allErrs
}
// ValidatePodUpdate tests to see if the update is legal
// ValidatePodUpdate tests to see if the update is legal for an end user to make. newPod is updated with fields
// that cannot be changed.
func ValidatePodUpdate(newPod, oldPod *api.Pod) errs.ValidationErrorList {
allErrs := errs.ValidationErrorList{}
@@ -584,6 +585,7 @@ func ValidatePodUpdate(newPod, oldPod *api.Pod) errs.ValidationErrorList {
allErrs = append(allErrs, errs.NewFieldInvalid("spec.containers", newPod.Spec.Containers, "some fields are immutable"))
}
newPod.Status = oldPod.Status
return allErrs
}