Improve error message for invalid pod spec update

pull/6/head
Filip Grzadkowski 2015-03-24 17:11:16 +01:00
parent 0902ffd70e
commit b74b203da2
1 changed files with 1 additions and 2 deletions

View File

@ -692,8 +692,7 @@ func ValidatePodUpdate(newPod, oldPod *api.Pod) errs.ValidationErrorList {
}
pod.Spec.Containers = newContainers
if !api.Semantic.DeepEqual(pod.Spec, oldPod.Spec) {
// TODO: a better error would include all immutable fields explicitly.
allErrs = append(allErrs, errs.NewFieldInvalid("spec.containers", newPod.Spec.Containers, "some fields are immutable"))
allErrs = append(allErrs, errs.NewFieldInvalid("spec", newPod.Spec, "may not update fields other than container.image"))
}
newPod.Status = oldPod.Status