From b74b203da2f2f70274ae4d95a2404a3d823396e1 Mon Sep 17 00:00:00 2001 From: Filip Grzadkowski Date: Tue, 24 Mar 2015 17:11:16 +0100 Subject: [PATCH] Improve error message for invalid pod spec update --- pkg/api/validation/validation.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/api/validation/validation.go b/pkg/api/validation/validation.go index 391f7fba5aaa2..bb0145310ceba 100644 --- a/pkg/api/validation/validation.go +++ b/pkg/api/validation/validation.go @@ -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