From cb329c31c054e59b092a9fe1efd6c754e1ce73ea Mon Sep 17 00:00:00 2001 From: Joe Kralicky Date: Fri, 25 Jun 2021 15:21:43 -0400 Subject: [PATCH] Use foreground deletion propagation when uninstalling opni --- pkg/opnictl/commands/uninstall.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/opnictl/commands/uninstall.go b/pkg/opnictl/commands/uninstall.go index 417dc75df7..bde6b12569 100644 --- a/pkg/opnictl/commands/uninstall.go +++ b/pkg/opnictl/commands/uninstall.go @@ -11,9 +11,10 @@ import ( "github.com/ttacon/chalk" "github.com/vbauerster/mpb/v7" "github.com/vbauerster/mpb/v7/decor" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/client-go/dynamic" + "k8s.io/utils/pointer" ) func BuildUninstallCmd() *cobra.Command { @@ -47,7 +48,10 @@ Opni from, unless the --context flag is provided to select a specific context.`, return dr.Delete( cmd.Context(), obj.GetName(), - v1.DeleteOptions{}, + metav1.DeleteOptions{ + PropagationPolicy: (*metav1.DeletionPropagation)( + pointer.String((string)(metav1.DeletePropagationForeground))), + }, ) }) spinner.Increment()