From e6748d4413504c0c4e66754e53d8021fcb1a722a Mon Sep 17 00:00:00 2001 From: Adam Krpan Date: Tue, 8 Oct 2019 09:17:20 -0700 Subject: [PATCH] Added a line to delete the SSL secret in the uninstall step --- pkg/puctl/pure1unplugged/uninstall.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/puctl/pure1unplugged/uninstall.go b/pkg/puctl/pure1unplugged/uninstall.go index 03a36468..f6a029ed 100644 --- a/pkg/puctl/pure1unplugged/uninstall.go +++ b/pkg/puctl/pure1unplugged/uninstall.go @@ -17,6 +17,7 @@ package pure1unplugged import ( "errors" "fmt" + "github.com/PureStorage-OpenConnect/pure1-unplugged/pkg/puctl/kube" "github.com/PureStorage-OpenConnect/pure1-unplugged/pkg/util/cli" ) @@ -62,7 +63,13 @@ func helmDeleteWithPurge(ctx cli.Context) error { // We know that the helm delete will leave behind PVC's and the namespace (helm purposely won't delete them..) // this is our chance to remove them func deleteLeftovers(ctx cli.Context) error { - _, err := kube.RunKubeCTLWithNamespace(ctx.Exec, kube.Pure1UnpluggedNamespace, "delete", "pvc", "--all") + _, err := kube.RunKubeCTLWithNamespace(ctx.Exec, kube.Pure1UnpluggedNamespace, "delete", "secret", pure1unpluggedHTTPSCertSecretName, "--ignore-not-found", "true") + if err != nil { + err = fmt.Errorf("failed to delete SSL secret: %s", err.Error()) + return err + } + + _, err = kube.RunKubeCTLWithNamespace(ctx.Exec, kube.Pure1UnpluggedNamespace, "delete", "pvc", "--all") if err != nil { err = fmt.Errorf("failed to delete PVC's: %s", err.Error()) return err