Skip to content

Commit f6e67a0

Browse files
author
Ravi Sankar Penta
committed
Bug 1534720 - SDN node should fetch latest local HostSubnet for the node
1 parent 86d4f94 commit f6e67a0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/network/node/subnets.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ func (node *OsdnNode) getLocalSubnet() (string, error) {
4141
var err error
4242
subnet, err = node.networkClient.Network().HostSubnets().Get(node.hostName, metav1.GetOptions{})
4343
if err == nil {
44-
return true, nil
44+
if subnet.HostIP == node.localIP {
45+
return true, nil
46+
} else {
47+
glog.Warningf("HostIP %q for local subnet does not match with nodeIP %q, "+
48+
"Waiting for master to update subnet for node %q ...", subnet.HostIP, node.localIP, node.hostName)
49+
return false, nil
50+
}
4551
} else if kapierrors.IsNotFound(err) {
4652
glog.Warningf("Could not find an allocated subnet for node: %s, Waiting...", node.hostName)
4753
return false, nil

0 commit comments

Comments
 (0)