diff --git a/pkg/services/apiserver/builder/runner/admission.go b/pkg/services/apiserver/builder/runner/admission.go index 91c873789b8..5a5d65d0143 100644 --- a/pkg/services/apiserver/builder/runner/admission.go +++ b/pkg/services/apiserver/builder/runner/admission.go @@ -30,13 +30,9 @@ func (b *appBuilder) Mutate(ctx context.Context, a admission.Attributes, o admis } obj := a.GetObject() - if obj == nil { - return errors.New("object is nil") + if obj != nil && resp.UpdatedObject != nil { + reflect.ValueOf(obj).Elem().Set(reflect.ValueOf(resp.UpdatedObject).Elem()) } - if resp.UpdatedObject == nil { - return errors.New("updated object is nil") - } - reflect.ValueOf(obj).Elem().Set(reflect.ValueOf(resp.UpdatedObject).Elem()) return nil }