Allow override AllowCreateOnUpdate with new argument to Update

This commit is contained in:
jennybuckley
2018-06-28 14:24:51 -07:00
parent 0d9c432542
commit d10e08fc89
64 changed files with 161 additions and 160 deletions

View File

@@ -89,6 +89,6 @@ func (r *StatusREST) Get(ctx context.Context, name string, options *metav1.GetOp
}
// Update alters the status subset of an object.
func (r *StatusREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc) (runtime.Object, bool, error) {
return r.store.Update(ctx, name, objInfo, createValidation, updateValidation)
func (r *StatusREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool) (runtime.Object, bool, error) {
return r.store.Update(ctx, name, objInfo, createValidation, updateValidation, forceAllowCreate)
}

View File

@@ -194,7 +194,7 @@ func TestUpdateStatus(t *testing.T) {
},
}
_, _, err = statusStorage.Update(ctx, autoscalerIn.Name, rest.DefaultUpdatedObjectInfo(autoscalerIn), rest.ValidateAllObjectFunc, rest.ValidateAllObjectUpdateFunc)
_, _, err = statusStorage.Update(ctx, autoscalerIn.Name, rest.DefaultUpdatedObjectInfo(autoscalerIn), rest.ValidateAllObjectFunc, rest.ValidateAllObjectUpdateFunc, false)
if err != nil {
t.Fatalf("Unexpected error: %v", err)
}