Skip to content

Commit b6f4bb3

Browse files
committed
kubeadm: upload the ClusterConfiguration during the upgrade
During the upgrade process, `kubeadm` will take the current `ClusterConfiguration`, update the `KubernetesVersion` to the latest version, and call to `UploadConfiguration`. This change makes sure that when the mutation happens, not only the `ClusterStatus` is mutated, but the `ClusterConfiguration` object inside the `kubeadm-config` ConfigMap as well; it will contain the new `KubernetesVersion`.
1 parent ad57e74 commit b6f4bb3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/kubeadm/app/phases/uploadconfig/uploadconfig.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ func UploadConfiguration(cfg *kubeadmapi.InitConfiguration, client clientset.Int
101101
kubeadmconstants.ClusterStatusConfigMapKey: string(clusterStatusYaml),
102102
},
103103
}, func(cm *v1.ConfigMap) error {
104+
// Upgrade will call to UploadConfiguration with a modified KubernetesVersion reflecting the new
105+
// Kubernetes version. In that case, the mutation path will take place.
106+
cm.Data[kubeadmconstants.ClusterConfigurationConfigMapKey] = string(clusterConfigurationYaml)
107+
// Mutate the ClusterStatus now
104108
return mutateClusterStatus(cm, func(cs *kubeadmapi.ClusterStatus) error {
105109
// Handle a nil APIEndpoints map. Should only happen if someone manually
106110
// interacted with the ConfigMap.

0 commit comments

Comments
 (0)