mirror of
https://github.com/grafana/grafana.git
synced 2025-01-15 19:22:34 -06:00
Playlist: Fix mutation logic (#95925)
This commit is contained in:
parent
280c27507c
commit
ed52515ae3
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user