From 2907e32f188cf9173a0d02a77635b4f067cd6016 Mon Sep 17 00:00:00 2001 From: fabiankramm Date: Fri, 7 May 2021 13:55:03 +0200 Subject: [PATCH] fix: no create validation in update --- pkg/apiserver/registry/account/rest.go | 6 ------ pkg/apiserver/registry/space/rest.go | 6 ------ 2 files changed, 12 deletions(-) diff --git a/pkg/apiserver/registry/account/rest.go b/pkg/apiserver/registry/account/rest.go index 63ec8eb9..12642a20 100644 --- a/pkg/apiserver/registry/account/rest.go +++ b/pkg/apiserver/registry/account/rest.go @@ -196,12 +196,6 @@ func (r *accountREST) Update(ctx context.Context, name string, objInfo rest.Upda return nil, false, fmt.Errorf("New object is not an account") } - if createValidation != nil { - err := createValidation(ctx, newAccount) - if err != nil { - return nil, false, err - } - } if updateValidation != nil { err := updateValidation(ctx, newAccount, oldObj) if err != nil { diff --git a/pkg/apiserver/registry/space/rest.go b/pkg/apiserver/registry/space/rest.go index 01e7d193..6848a7b6 100644 --- a/pkg/apiserver/registry/space/rest.go +++ b/pkg/apiserver/registry/space/rest.go @@ -440,12 +440,6 @@ func (r *spaceStorage) Update(ctx context.Context, name string, objInfo rest.Upd return nil, false, fmt.Errorf("new object is not a space") } - if createValidation != nil { - err = createValidation(ctx, newSpace) - if err != nil { - return nil, false, err - } - } if updateValidation != nil { err = updateValidation(ctx, newSpace, oldObj) if err != nil {