diff --git a/store/proxy/proxy_store.go b/store/proxy/proxy_store.go index 8dec82cd0..cff8e5da9 100644 --- a/store/proxy/proxy_store.go +++ b/store/proxy/proxy_store.go @@ -335,14 +335,14 @@ func (p *Store) Delete(apiContext *types.APIContext, schema *types.Schema, id st return nil, err } - namespace, id := splitID(id) + namespace, name := splitID(id) prop := metav1.DeletePropagationForeground req := p.common(namespace, k8sClient.Delete()). Body(&metav1.DeleteOptions{ PropagationPolicy: &prop, }). - Name(id) + Name(name) err = p.doAuthed(apiContext, req).Error() if err != nil { diff --git a/store/transform/transform.go b/store/transform/transform.go index 9dbc038f3..0adaa747d 100644 --- a/store/transform/transform.go +++ b/store/transform/transform.go @@ -107,5 +107,9 @@ func (s *Store) Update(apiContext *types.APIContext, schema *types.Schema, data } func (s *Store) Delete(apiContext *types.APIContext, schema *types.Schema, id string) (map[string]interface{}, error) { - return s.Store.Delete(apiContext, schema, id) + obj, err := s.Store.Delete(apiContext, schema, id) + if err != nil || obj == nil { + return obj, err + } + return s.Transformer(apiContext, schema, obj, nil) }