Skip to content

Commit

Permalink
fix: improve liqoctl uninstall error message
Browse files Browse the repository at this point in the history
this patch improves the liqoctl uninstall error message when the
pre-uninstall checks fail, by suggesting the user which command has to
be used to unpeer a cluster.
  • Loading branch information
claudiolor committed Nov 21, 2024
1 parent 7abcb94 commit 4aa56fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/liqoctl/uninstall/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ func (o *Options) Run(ctx context.Context) error {

s := o.Printer.StartSpinner("Running pre-uninstall checks")
if err := utils.PreUninstall(ctx, o.CRClient); err != nil {
s.Fail("Pre-uninstall checks failed: ", output.PrettyErr(err))
errMsg := fmt.Sprintf("Pre-uninstall checks failed: %s\n"+
"You can disable the active peerings with other clusters with the 'liqoctl unpeer' command.\n"+
"Check 'liqoctl unpeer --help' for further information.", output.PrettyErr(err))
s.Fail(errMsg)
return err
}
s.Success("Pre-uninstall checks passed")
Expand Down

0 comments on commit 4aa56fe

Please sign in to comment.