mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #129429 from neolit123/automated-cherry-pick-of-#129418-origin-release-1.32-1735554474
Automated cherry pick of #129418 kubeadm: skip disabled addons in clusterconfig on upgrade
This commit is contained in:
commit
08ec9118a0
@ -83,13 +83,20 @@ func getInitData(c workflow.RunData) (*kubeadmapi.InitConfiguration, clientset.I
|
||||
|
||||
// runCoreDNSAddon upgrades the CoreDNS addon.
|
||||
func runCoreDNSAddon(c workflow.RunData) error {
|
||||
const skipMessagePrefix = "[upgrade/addon] Skipping the addon/coredns phase."
|
||||
|
||||
cfg, client, patchesDir, out, dryRun, isControlPlaneNode, err := getInitData(c)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !isControlPlaneNode {
|
||||
fmt.Println("[upgrade/addon] Skipping addon/coredns phase. Not a control plane node.")
|
||||
fmt.Fprintf(out, "%s Not a control plane node.\n", skipMessagePrefix)
|
||||
return nil
|
||||
}
|
||||
|
||||
if cfg.ClusterConfiguration.DNS.Disabled {
|
||||
fmt.Fprintf(out, "%s The addon is disabled.\n", skipMessagePrefix)
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -110,13 +117,20 @@ func runCoreDNSAddon(c workflow.RunData) error {
|
||||
|
||||
// runKubeProxyAddon upgrades the kube-proxy addon.
|
||||
func runKubeProxyAddon(c workflow.RunData) error {
|
||||
const skipMessagePrefix = "[upgrade/addon] Skipping the addon/kube-proxy phase."
|
||||
|
||||
cfg, client, _, out, dryRun, isControlPlaneNode, err := getInitData(c)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !isControlPlaneNode {
|
||||
fmt.Println("[upgrade/addon] Skipping addon/kube-proxy phase. Not a control plane node.")
|
||||
fmt.Fprintf(out, "%s Not a control plane node.\n", skipMessagePrefix)
|
||||
return nil
|
||||
}
|
||||
|
||||
if cfg.ClusterConfiguration.Proxy.Disabled {
|
||||
fmt.Fprintf(out, "%s The addon is disabled.\n", skipMessagePrefix)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user