mirror of
https://github.com/fluxcd/flux2.git
synced 2026-05-05 17:44:44 +00:00
Display better uninstall prompt if flux is managed by a different tool
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
This commit is contained in:
parent
2f15ad972b
commit
9cd4a7215f
2 changed files with 27 additions and 11 deletions
|
|
@ -91,7 +91,7 @@ func getFluxClusterInfo(ctx context.Context, c client.Client) (fluxClusterInfo,
|
|||
// promptui.ErrAbort if the user doesn't confirm, or an error encountered.
|
||||
func confirmFluxInstallOverride(info fluxClusterInfo) error {
|
||||
// no need to display prompt if installation is managed by Flux
|
||||
if info.managedBy == "" || info.managedBy == "flux" {
|
||||
if installManagedByFlux(info.managedBy) {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -104,3 +104,7 @@ func confirmFluxInstallOverride(info fluxClusterInfo) error {
|
|||
_, err := prompt.Run()
|
||||
return err
|
||||
}
|
||||
|
||||
func installManagedByFlux(manager string) bool {
|
||||
return manager == "" || manager == "flux"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue