summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/internal/app/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/k8splugin/internal/app/client.go')
-rw-r--r--src/k8splugin/internal/app/client.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/k8splugin/internal/app/client.go b/src/k8splugin/internal/app/client.go
index 06c4c464..f70dc0a5 100644
--- a/src/k8splugin/internal/app/client.go
+++ b/src/k8splugin/internal/app/client.go
@@ -550,18 +550,17 @@ func (k *KubernetesClient) DeleteKind(resource helm.KubernetesResource, namespac
return pkgerrors.Wrap(err, "Error loading plugin")
}
- name, err := pluginImpl.Get(resource, namespace, k)
+ err = pluginImpl.Delete(resource, namespace, k)
- if (err == nil && name == resource.Name) || (err != nil && strings.Contains(err.Error(), "not found") == false) {
- err = pluginImpl.Delete(resource, namespace, k)
- if err != nil {
+ if err != nil {
+ if strings.Contains(err.Error(), "not found") == false {
return pkgerrors.Wrap(err, "Error deleting "+resource.Name)
+ } else {
+ log.Warn("Resource already does not exist", log.Fields{
+ "gvk": resource.GVK,
+ "resource": resource.Name,
+ })
}
- } else {
- log.Warn("Resource does not exist, Skipping delete", log.Fields{
- "gvk": resource.GVK,
- "resource": resource.Name,
- })
}
return nil