Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

claudiolor
Copy link
Contributor

Description

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.

Closes #2821

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.
@adamjensenbot
Copy link
Collaborator

Hi @claudiolor. Thanks for your PR!

I am @adamjensenbot.
You can interact with me issuing a slash command in the first line of a comment.
Currently, I understand the following commands:

  • /rebase: Rebase this PR onto the master branch (You can add the option test=true to launch the tests
    when the rebase operation is completed)
  • /merge: Merge this PR into the master branch
  • /build Build Liqo components
  • /test Launch the E2E and Unit tests
  • /hold, /unhold Add/remove the hold label to prevent merging with /merge

Make sure this PR appears in the liqo changelog, adding one of the following labels:

  • kind/breaking: 💥 Breaking Change
  • kind/feature: 🚀 New Feature
  • kind/bug: 🐛 Bug Fix
  • kind/cleanup: 🧹 Code Refactoring
  • kind/docs: 📝 Documentation

@@ -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"+
Copy link
Member

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

@@ -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"+
Copy link
Member

Choose a reason for hiding this comment

The 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...."
Saying "you can", it means (to me) that it's just a suggestion, not a mandatory requirement to proceed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.
We might add at the end of the error message something like:

  • To disable active peering launch liqoctl X
  • To unoffload a namespace launch liqoctl Y

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 liqoctl when the user is not actually using it. So we should add a logic to understand when we are using liqoctl and print the suggestion. However, I'm not sure if it is worth it.
What do you guys think? @aleoli @fra98 @cheina97

Maybe in future, it would be nice having a flag like --force that automatically removes everything that prevents Liqo from being uninstalled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue on liqo uninstallation
4 participants