Merge pull request #77513 from ereslibre/upload-cluster-configuration-after-upgrade

kubeadm: upload the `ClusterConfiguration` during the upgrade
This commit is contained in:
Kubernetes Prow Robot 2019-05-08 17:15:13 -07:00 committed by GitHub
commit eda5a296a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -101,6 +101,10 @@ func UploadConfiguration(cfg *kubeadmapi.InitConfiguration, client clientset.Int
kubeadmconstants.ClusterStatusConfigMapKey: string(clusterStatusYaml), kubeadmconstants.ClusterStatusConfigMapKey: string(clusterStatusYaml),
}, },
}, func(cm *v1.ConfigMap) error { }, 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 { return mutateClusterStatus(cm, func(cs *kubeadmapi.ClusterStatus) error {
// Handle a nil APIEndpoints map. Should only happen if someone manually // Handle a nil APIEndpoints map. Should only happen if someone manually
// interacted with the ConfigMap. // interacted with the ConfigMap.