diff --git a/api/http/proxy/factory/kubernetes/namespaces.go b/api/http/proxy/factory/kubernetes/namespaces.go index daa71749f..c501f7cc7 100644 --- a/api/http/proxy/factory/kubernetes/namespaces.go +++ b/api/http/proxy/factory/kubernetes/namespaces.go @@ -46,5 +46,19 @@ func (transport *baseTransport) proxyNamespaceDeleteOperation(request *http.Requ } } } + + stacks, err := transport.dataStore.Stack().Stacks() + if err != nil { + return nil, err + } + + for _, s := range stacks { + if s.Namespace == namespace && s.EndpointID == transport.endpoint.ID { + if err := transport.dataStore.Stack().DeleteStack(s.ID); err != nil { + return nil, err + } + } + } + return transport.executeKubernetesRequest(request) }