Skip to content

Commit 3bf4ca0

Browse files
authored
Merge pull request #1156 from lukasmacko/master
Fix advertising of mgmt IPs
2 parents f51a678 + 612e755 commit 3bf4ca0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

plugins/contiv/plugin_impl_contiv.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,14 +560,17 @@ func (plugin *Plugin) handleKsrNodeResync(it datasync.KeyValIterator) error {
560560
}
561561

562562
if value.Name == plugin.ServiceLabel.GetAgentLabel() {
563-
var internalIP string
563+
var internalIPs []string
564564
for i := range value.Addresses {
565565
if value.Addresses[i].Type == protoNode.NodeAddress_NodeInternalIP {
566-
internalIP = value.Addresses[i].Address
567-
plugin.Log.Info("Internal IP of the node is ", internalIP)
568-
return plugin.nodeIDAllocator.updateManagementIP(internalIP)
566+
internalIPs = append(internalIPs, value.Addresses[i].Address)
569567
}
570568
}
569+
if len(internalIPs) > 0 {
570+
ips := strings.Join(internalIPs, MgmtIPSeparator)
571+
plugin.Log.Info("Internal IP of the node is ", ips)
572+
return plugin.nodeIDAllocator.updateManagementIP(ips)
573+
}
571574
}
572575
plugin.Log.Debug("Internal IP of the node is not in ETCD yet.")
573576
}

0 commit comments

Comments
 (0)