mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-11 01:41:54 -04:00
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`.
This commit is contained in:
parent
ad57e7408d
commit
b6f4bb349b
1 changed files with 4 additions and 0 deletions
|
|
@ -101,6 +101,10 @@ func UploadConfiguration(cfg *kubeadmapi.InitConfiguration, client clientset.Int
|
|||
kubeadmconstants.ClusterStatusConfigMapKey: string(clusterStatusYaml),
|
||||
},
|
||||
}, func(cm *v1.ConfigMap) error {
|
||||
// Upgrade will call to UploadConfiguration with a modified KubernetesVersion reflecting the new
|
||||
// Kubernetes version. In that case, the mutation path will take place.
|
||||
cm.Data[kubeadmconstants.ClusterConfigurationConfigMapKey] = string(clusterConfigurationYaml)
|
||||
// Mutate the ClusterStatus now
|
||||
return mutateClusterStatus(cm, func(cs *kubeadmapi.ClusterStatus) error {
|
||||
// Handle a nil APIEndpoints map. Should only happen if someone manually
|
||||
// interacted with the ConfigMap.
|
||||
|
|
|
|||
Loading…
Reference in a new issue