Skip to content

Commit

Permalink
Merge pull request #71 from rancher/fix-delete-propagation
Browse files Browse the repository at this point in the history
Use foreground deletion propagation when uninstalling opni
  • Loading branch information
kralicky authored Jun 25, 2021
2 parents df15f7a + cb329c3 commit 16bd07a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/opnictl/commands/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 16bd07a

Please sign in to comment.