Allow update without resource version

This commit is contained in:
nikhiljindal
2015-06-18 17:42:01 -07:00
parent ebeb104493
commit 221ae4d63b
20 changed files with 135 additions and 36 deletions

View File

@@ -87,3 +87,7 @@ func (svcStrategy) AllowCreateOnUpdate() bool {
func (svcStrategy) ValidateUpdate(ctx api.Context, obj, old runtime.Object) fielderrors.ValidationErrorList {
return validation.ValidateServiceUpdate(old.(*api.Service), obj.(*api.Service))
}
func (svcStrategy) AllowUnconditionalUpdate() bool {
return true
}

View File

@@ -40,6 +40,8 @@ type RESTUpdateStrategy interface {
// ValidateUpdate is invoked after default fields in the object have been filled in before
// the object is persisted.
ValidateUpdate(ctx api.Context, obj, old runtime.Object) fielderrors.ValidationErrorList
// AllowUnconditionalUpdate returns true if the object can be updated unconditionally (irrespective of the latest resource version), when there is no resource version specified in the object.
AllowUnconditionalUpdate() bool
}
// BeforeUpdate ensures that common operations for all resources are performed on update. It only returns