Merge pull request #56008 from xiangpengzhao/kubeadm-dkc-panic

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix panic when assigning configmap UID of kubelet configuration.

**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes https://github.com/kubernetes/kubeadm/issues/553

**Special notes for your reviewer**:
/cc @luxas 

**Release note**:

```release-note
NONE
```
This commit is contained in:
Kubernetes Submit Queue 2017-11-19 02:33:26 -08:00 committed by GitHub
commit 3447dc0b13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,7 +86,13 @@ func UpdateNodeWithConfigMap(client clientset.Interface, nodeName string) error
return false, nil
}
node.Spec.ConfigSource.ConfigMapRef.UID = kubeletCfg.UID
node.Spec.ConfigSource = &v1.NodeConfigSource{
ConfigMapRef: &v1.ObjectReference{
Name: kubeadmconstants.KubeletBaseConfigurationConfigMap,
Namespace: metav1.NamespaceSystem,
UID: kubeletCfg.UID,
},
}
newData, err := json.Marshal(node)
if err != nil {