1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-01 07:08:38 +00:00

Merge pull request #2900 from rayandas/rayandas-fix-coredns-addons

Add logic to fix coreDNS add-on config issue while cluster upgrade
This commit is contained in:
Sameer Kulkarni 2022-04-13 09:13:35 +05:30 committed by GitHub
commit 0043b89338
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -186,6 +186,18 @@ func (c *Cluster) deployK8sAddOns(ctx context.Context, data map[string]interface
func (c *Cluster) deployUserAddOns(ctx context.Context) error {
log.Infof(ctx, "[addons] Setting up user addons")
if c.Addons != "" {
addonJobExists, err := addons.AddonJobExists(UserAddonJobName, c.LocalKubeConfigPath, c.K8sWrapTransport)
if err != nil {
return nil
}
if addonJobExists {
log.Infof(ctx, "[addons] Removing old user addons")
if err := c.doAddonDelete(ctx, UserAddonResourceName, false); err != nil {
return err
}
log.Infof(ctx, "[addons] Old user addons removed successfully")
}
if err := c.doAddonDeploy(ctx, c.Addons, UserAddonResourceName, false); err != nil {
return err
}