@@ -83,13 +83,20 @@ func getInitData(c workflow.RunData) (*kubeadmapi.InitConfiguration, clientset.I
83
83
84
84
// runCoreDNSAddon upgrades the CoreDNS addon.
85
85
func runCoreDNSAddon (c workflow.RunData ) error {
86
+ const skipMessagePrefix = "[upgrade/addon] Skipping the addon/coredns phase."
87
+
86
88
cfg , client , patchesDir , out , dryRun , isControlPlaneNode , err := getInitData (c )
87
89
if err != nil {
88
90
return err
89
91
}
90
92
91
93
if ! isControlPlaneNode {
92
- fmt .Println ("[upgrade/addon] Skipping addon/coredns phase. Not a control plane node." )
94
+ fmt .Fprintf (out , "%s Not a control plane node.\n " , skipMessagePrefix )
95
+ return nil
96
+ }
97
+
98
+ if cfg .ClusterConfiguration .DNS .Disabled {
99
+ fmt .Fprintf (out , "%s The addon is disabled.\n " , skipMessagePrefix )
93
100
return nil
94
101
}
95
102
@@ -110,13 +117,20 @@ func runCoreDNSAddon(c workflow.RunData) error {
110
117
111
118
// runKubeProxyAddon upgrades the kube-proxy addon.
112
119
func runKubeProxyAddon (c workflow.RunData ) error {
120
+ const skipMessagePrefix = "[upgrade/addon] Skipping the addon/kube-proxy phase."
121
+
113
122
cfg , client , _ , out , dryRun , isControlPlaneNode , err := getInitData (c )
114
123
if err != nil {
115
124
return err
116
125
}
117
126
118
127
if ! isControlPlaneNode {
119
- fmt .Println ("[upgrade/addon] Skipping addon/kube-proxy phase. Not a control plane node." )
128
+ fmt .Fprintf (out , "%s Not a control plane node.\n " , skipMessagePrefix )
129
+ return nil
130
+ }
131
+
132
+ if cfg .ClusterConfiguration .Proxy .Disabled {
133
+ fmt .Fprintf (out , "%s The addon is disabled.\n " , skipMessagePrefix )
120
134
return nil
121
135
}
122
136
0 commit comments