add delete precondition

This commit is contained in:
Chao Xu
2016-03-20 23:15:00 -07:00
parent 590038dcf1
commit 31b425b3a1
71 changed files with 1600 additions and 372 deletions

View File

@@ -97,6 +97,7 @@ func NewREST(opts generic.RESTOptions) (*REST, *StatusREST) {
// Used to validate controller updates
UpdateStrategy: controller.Strategy,
DeleteStrategy: controller.Strategy,
Storage: storageInterface,
}

View File

@@ -118,11 +118,6 @@ func TestUpdate(t *testing.T) {
return object
},
// invalid updateFunc
func(obj runtime.Object) runtime.Object {
object := obj.(*api.ReplicationController)
object.UID = "newUID"
return object
},
func(obj runtime.Object) runtime.Object {
object := obj.(*api.ReplicationController)
object.Name = ""