Commit 4453f2c7 authored by xiangpengzhao's avatar xiangpengzhao

Fix panic when assigning configmap UID of kubelet configuration.

parent d52d1602
......@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment