Commit ae909c73 authored by Jamie Phillips's avatar Jamie Phillips Committed by Brad Davidson

Updated the code to use GetNetworkByName and tweaked logic.

Updated the method being called and tweaked the logic. Signed-off-by: 's avatarJamie Phillips <jamie.phillips@suse.com>
parent 4cc781b5
...@@ -133,12 +133,15 @@ func kubeletArgs(cfg *config.Agent) map[string]string { ...@@ -133,12 +133,15 @@ func kubeletArgs(cfg *config.Agent) map[string]string {
func waitForManagementIp(networkName string) string { func waitForManagementIp(networkName string) string {
for range time.Tick(time.Second * 5) { for range time.Tick(time.Second * 5) {
network, err := hcsshim.GetHNSEndpointByName(networkName) network, err := hcsshim.GetHNSNetworkByName(networkName)
if err != nil { if err != nil {
logrus.WithError(err).Warning("can't find HNS endpoint for network, retrying", networkName) logrus.WithError(err).Warning("can't find HNS network, retrying", networkName)
continue continue
} }
return network.IPAddress.String() if network.ManagementIP == "" {
continue
}
return network.ManagementIP
} }
return "" return ""
} }
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