fix panic in kubelet

pull/6/head
fisherxu 2017-11-01 17:06:17 +08:00
parent 7f9f847ce9
commit 04b876e63c
1 changed files with 3 additions and 0 deletions

View File

@ -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.