mirror of https://github.com/k3s-io/k3s
Improve error message for invalid pod spec update
parent
0902ffd70e
commit
b74b203da2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue