From 715eacd0ec7080bd34795829cf9112af0ab64305 Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Mon, 9 Apr 2018 16:33:08 -0700 Subject: [PATCH] Fix 204 on DELETE --- store/proxy/proxy_store.go | 4 ++-- store/transform/transform.go | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) 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) }