Commit 04b876e6 authored by fisherxu's avatar fisherxu

fix panic in kubelet

parent 7f9f847c
......@@ -445,6 +445,9 @@ func (kl *Kubelet) setNodeAddress(node *v1.Node) error {
if kl.externalCloudProvider {
if kl.nodeIP != nil {
if node.ObjectMeta.Annotations == nil {
node.ObjectMeta.Annotations = make(map[string]string)
}
node.ObjectMeta.Annotations[kubeletapis.AnnotationProvidedIPAddr] = kl.nodeIP.String()
}
// We rely on the external cloud provider to supply the addresses.
......
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