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 c202315 commit d29c8cd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/uninstall/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ func (obj *uninstaller) UninstallBlocking(ctx context.Context, pkg ctrlpkg.Packa
return err
}

return obj.awaitDeletion(ctx, pkg, isDryRun)
if isDryRun {
return nil
} else {
return obj.awaitDeletion(ctx, pkg)
}
}

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

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

func (obj *uninstaller) awaitDeletion(ctx context.Context, pkg ctrlpkg.Package) error {
watcher, err := obj.createWatcher(ctx, pkg)
if err != nil {
return err
Expand Down

0 comments on commit d29c8cd

Please sign in to comment.