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: hold the force uninstalling process untill the last addon been deleted #4101

Merged
merged 3 commits into from Jun 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions references/cli/uninstall.go
Expand Up @@ -209,6 +209,21 @@ func forceDisableAddon(ctx context.Context, kubeClient client.Client, config *re
if err := pkgaddon.DisableAddon(ctx, kubeClient, "fluxcd", config, true); err != nil {
return err
}
timeConsumed = time.Now()
for {
if time.Now().After(timeConsumed.Add(5 * time.Minute)) {
return errors.New("timeout disable fluxcd addon, please disable the addon manually")
}
addons, err := checkInstallAddon(kubeClient)
wangyikewxgm marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
return err
}
if len(addons) == 0 {
break
}
fmt.Printf("Waiting delete the fluxcd addon, timeout left %s . \r\n", 5*time.Minute-time.Since(timeConsumed))
time.Sleep(2 * time.Second)
}
}
return nil
}