Merge pull request #5690 from satnam6502/failputnover
Give better error message for PUTs with no resource version
This commit is contained in:
@@ -232,6 +232,11 @@ func ValidateObjectMetaUpdate(old, meta *api.ObjectMeta) errs.ValidationErrorLis
|
||||
meta.CreationTimestamp = old.CreationTimestamp
|
||||
}
|
||||
|
||||
// Reject updates that don't specify a resource version
|
||||
if meta.ResourceVersion == "" {
|
||||
allErrs = append(allErrs, errs.NewFieldInvalid("resourceVersion", meta.ResourceVersion, "resourceVersion must be specified for an update"))
|
||||
}
|
||||
|
||||
if old.Name != meta.Name {
|
||||
allErrs = append(allErrs, errs.NewFieldInvalid("name", meta.Name, "field is immutable"))
|
||||
}
|
||||
|
Reference in New Issue
Block a user