mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-27 16:17:34 +00:00
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>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user