@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
14
14
limitations under the License.
15
15
*/
16
16
17
+ // Package node implements phases of 'kubeadm upgrade node'.
17
18
package node
18
19
19
20
import (
@@ -28,13 +29,14 @@ import (
28
29
"k8s.io/kubernetes/cmd/kubeadm/app/util/apiclient"
29
30
)
30
31
31
- // NewControlPlane creates a kubeadm workflow phase that implements handling of control-plane upgrade .
32
+ // NewControlPlane returns a new control-plane phase .
32
33
func NewControlPlane () workflow.Phase {
33
34
phase := workflow.Phase {
34
35
Name : "control-plane" ,
35
36
Short : "Upgrade the control plane instance deployed on this node, if any" ,
36
37
Run : runControlPlane (),
37
38
InheritFlags : []string {
39
+ options .CfgPath ,
38
40
options .DryRun ,
39
41
options .KubeconfigPath ,
40
42
options .CertificateRenewal ,
@@ -54,7 +56,7 @@ func runControlPlane() func(c workflow.RunData) error {
54
56
55
57
// if this is not a control-plane node, this phase should not be executed
56
58
if ! data .IsControlPlaneNode () {
57
- fmt .Println ("[upgrade] Skipping phase. Not a control plane node." )
59
+ fmt .Println ("[upgrade/control-plane ] Skipping phase. Not a control plane node." )
58
60
return nil
59
61
}
60
62
@@ -67,8 +69,9 @@ func runControlPlane() func(c workflow.RunData) error {
67
69
patchesDir := data .PatchesDir ()
68
70
69
71
// Upgrade the control plane and etcd if installed on this node
70
- fmt .Printf ("[upgrade] Upgrading your Static Pod-hosted control plane instance to version %q...\n " , cfg .KubernetesVersion )
72
+ fmt .Printf ("[upgrade/control-plane ] Upgrading your Static Pod-hosted control plane instance to version %q...\n " , cfg .KubernetesVersion )
71
73
if dryRun {
74
+ fmt .Printf ("[dryrun] Would upgrade your static Pod-hosted control plane to version %q" , cfg .KubernetesVersion )
72
75
return upgrade .DryRunStaticPodUpgrade (patchesDir , cfg )
73
76
}
74
77
@@ -78,11 +81,7 @@ func runControlPlane() func(c workflow.RunData) error {
78
81
return errors .Wrap (err , "couldn't complete the static pod upgrade" )
79
82
}
80
83
81
- if err := upgrade .PerformAddonsUpgrade (client , cfg , data .PatchesDir (), data .OutputWriter ()); err != nil {
82
- return errors .Wrap (err , "failed to perform addons upgrade" )
83
- }
84
-
85
- fmt .Println ("[upgrade] The control plane instance for this node was successfully updated!" )
84
+ fmt .Println ("[upgrade/control-plane] The control plane instance for this node was successfully upgraded!" )
86
85
87
86
return nil
88
87
}
0 commit comments