mirror of
https://github.com/kubevela/kubevela.git
synced 2026-05-06 01:17:09 +00:00
[Backport release-1.4] Fix: hold the force uninstalling process untill the last addon been deleted (#4103)
* 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> (cherry picked from commit1d4266432c) * fix comments Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com> fix lint Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com> (cherry picked from commitcecd8c28d0) * add period Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com> (cherry picked from commit62e4dac538) Co-authored-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
This commit is contained in:
committed by
GitHub
parent
23e29aa62a
commit
ea0508a634
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user