Skip to content

Commit

Permalink
Improve error message for invalid pod spec update
Browse files Browse the repository at this point in the history
  • Loading branch information
fgrzadkowski committed Mar 24, 2015
1 parent 0902ffd commit b74b203
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/api/validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b74b203

Please sign in to comment.