Skip to content

Commit

Permalink
Merge pull request openshift#18117 from pravisankar/fix-subnets
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 18117, 18049).

Bug 1534720 - SDN node should fetch latest local HostSubnet for the node
  • Loading branch information
openshift-merge-robot authored Jan 17, 2018
2 parents 363a5f4 + f6e67a0 commit 0201b09
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/network/node/subnets.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ func (node *OsdnNode) getLocalSubnet() (string, error) {
var err error
subnet, err = node.networkClient.Network().HostSubnets().Get(node.hostName, metav1.GetOptions{})
if err == nil {
return true, nil
if subnet.HostIP == node.localIP {
return true, nil
} else {
glog.Warningf("HostIP %q for local subnet does not match with nodeIP %q, "+
"Waiting for master to update subnet for node %q ...", subnet.HostIP, node.localIP, node.hostName)
return false, nil
}
} else if kapierrors.IsNotFound(err) {
glog.Warningf("Could not find an allocated subnet for node: %s, Waiting...", node.hostName)
return false, nil
Expand Down

0 comments on commit 0201b09

Please sign in to comment.