Skip to content

Commit

Permalink
feat(cli): add --dry-run to uninstall command
Browse files Browse the repository at this point in the history
Signed-off-by: hanshal101 <[email protected]>
  • Loading branch information
hanshal101 committed Aug 13, 2024
1 parent a21568a commit c202315
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/uninstall/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ func (obj *uninstaller) UninstallBlocking(ctx context.Context, pkg ctrlpkg.Packa
if err != nil {
return err
}
return obj.awaitDeletion(ctx, pkg)

return obj.awaitDeletion(ctx, pkg, isDryRun)
}

// Uninstall deletes the v1alpha1.Package custom resource from the cluster.
Expand Down Expand Up @@ -66,7 +67,11 @@ func (uninstaller *uninstaller) delete(ctx context.Context, pkg ctrlpkg.Package,
}
}

func (obj *uninstaller) awaitDeletion(ctx context.Context, pkg ctrlpkg.Package) error {
func (obj *uninstaller) awaitDeletion(ctx context.Context, pkg ctrlpkg.Package, isDryrun bool) error {
if isDryrun {
return nil
}

watcher, err := obj.createWatcher(ctx, pkg)
if err != nil {
return err
Expand Down

0 comments on commit c202315

Please sign in to comment.