Skip to content

Commit

Permalink
Fix: hold the force uninstalling process untill the last addon been d…
Browse files Browse the repository at this point in the history
…eleted (#4101)

* hold the force uninstalling process untill the last addon been deleted

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>

* fix comments

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

fix lint

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

* add period

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
  • Loading branch information
wangyikewxgm committed Jun 2, 2022
1 parent 7f3b55e commit a00fee9
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(5 * 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.Printf("Waiting delete the fluxcd addon, timeout left %s . \r\n", 5*time.Minute-time.Since(timeConsumed))
time.Sleep(2 * time.Second)
}
}
return nil
}

0 comments on commit a00fee9

Please sign in to comment.