Skip to content

Commit

Permalink
hold the force uninstalling process untill the last addon been deleted
Browse files Browse the repository at this point in the history
Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix lint

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix comments

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

fix comments

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
  • Loading branch information
wangyikewxgm committed Jun 2, 2022
1 parent e012bbd commit 1d42664
Showing 1 changed file with 15 additions and 0 deletions.
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(2 * time.Minute)) {
return errors.New("timeout disable fluxcd addon, please disable the addon manually")
}
addons, err := checkInstallAddon(kubeClient)
if err != nil {
return err
}
if len(addons) == 0 {
break
}
fmt.Println("Waiting delete the fluxcd addon......")
time.Sleep(5 * time.Second)
}
}
return nil
}

0 comments on commit 1d42664

Please sign in to comment.