-
Notifications
You must be signed in to change notification settings - Fork 620
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
Confirm before overriding installation by another manager #4355
Conversation
2bd5182
to
76e19e9
Compare
47bde51
to
2628ea9
Compare
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.
LGTM
Thanks @somtochiama 🥇
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.
The overall implementation looks good to me.
Left a minor suggestion.
I think the uninstall command can also be updated along the same lines to provide some extra information based on the cluster info. There's already a confirmation prompt for uninstall. We can just mention who is managing flux. By confirming, users will be acknowledging that although flux is managed by someone else, they want to proceed and uninstall. |
a409f4b
to
e5cb4d8
Compare
} | ||
} |
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.
Here we know that flux is not installed at all if there's an error and it's not found error. We can print some accurate message and quit early. At present, even if it's not installed, it blindly runs the uninstall operations.
? Are you sure you want to delete Flux and its custom resource definitions? [y/N] y
► deleting toolkit.fluxcd.io finalizers in all namespaces
► deleting toolkit.fluxcd.io custom resource definitions
✗ Namespace/flux-system deletion failed: namespaces "flux-system" not found
✔ uninstall finished
Ending with status code 0 is another issue which can be addressed separately.
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.
. Here we know that flux is not installed at all if there's an error and it's not found error.
Should we consider a case where the CRDs might not be present (maybe due to a previous incomplete uninstall) but the flux-system namespace is still present? Returning early will not delete the namespace
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.
We should always uninstall, this saved so many users from Helm uninstall and TF delete partial failures where some objects were stuck. I'm also not for extending this PR to uninstall, let's write an issue for improving the uninstall procedure if we must, and discuss there the specs.
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.
I think we can keep the uninstall prompt as it doesn't change any existing uninstall behaviour and only gives the user some more information. I will open a new issue for any other changes around the uninstall procedure.
2cd38df
to
d6f0247
Compare
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.
LGTM!
Left a comment about an old in-line comment that can be updated before merging.
Signed-off-by: Somtochi Onyekwere <[email protected]>
Signed-off-by: Somtochi Onyekwere <[email protected]>
d6f0247
to
9cd4a72
Compare
This pull request prompts a user to confirm before overriding an existing Flux installation that's not managed by flux when running
install
orbootstrap
.The pull request also adds a better uninstallation prompt when flux is managed by some other tool.
Fixes: #4342