-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fix] improve liqoctl uninstall error message #2825
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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"+ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would say "You must tear down the active peerings..." instead of "You can disable the active peering...." There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The issue here is that the errors might not be related to the active peerings, but as @aleoli said, there might be also the possibility that there still is an offloaded namespace or other resources to remove. So I wouldn't always print to "You must tear down the active peerings..." because this is not always the case.
Actually, the ideal solution would be changing the returned error message to suggest a solution for each of the returned error, but since this is a shared function, I wouldn't suggest to use Maybe in future, it would be nice having a flag like |
||
"Check 'liqoctl unpeer --help' for further information.", output.PrettyErr(err)) | ||
s.Fail(errMsg) | ||
return err | ||
} | ||
s.Success("Pre-uninstall checks passed") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we checking here also for offloaded namespaces? if so, I would add the command to unoffload namespaces too