1
0
mirror of synced 2026-02-13 13:06:56 +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:
Somtochi Onyekwere
2023-10-31 14:37:32 +01:00
parent 2f15ad972b
commit 9cd4a7215f
2 changed files with 27 additions and 11 deletions

View File

@@ -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"
}