Put the network-already-set-up check in the right place
This ended up in the wrong place after one of the rewrites/rebases. We
should check if everything is already set up correctly *before*
forcibly recreating lbr0.
@@ -117,6 +117,11 @@ func (c *FlowController) Setup(localSubnetCIDR, clusterNetworkCIDR, servicesNetw
glog.V(5).Infof("[SDN setup] node pod subnet %s gateway %s", ipnet.String(), localSubnetGateway)
gwCIDR := fmt.Sprintf("%s/%d", localSubnetGateway, localSubnetMaskLength)
+ if alreadySetUp(c.multitenant, gwCIDR) {
+ glog.V(5).Infof("[SDN setup] no SDN setup required")
+ return nil
+ }
+ glog.V(5).Infof("[SDN setup] full SDN setup required")
itx := ipcmd.NewTransaction(LBR)
itx.SetLink("down")
@@ -142,13 +147,6 @@ func (c *FlowController) Setup(localSubnetCIDR, clusterNetworkCIDR, servicesNetw
glog.V(5).Infof("[SDN setup] docker setup success:\n%s", out)
}
- if alreadySetUp(c.multitenant, gwCIDR) {
- glog.V(5).Infof("[SDN setup] no SDN setup required")
- return nil
- }
-
- glog.V(5).Infof("[SDN setup] full SDN setup required")
-
config := fmt.Sprintf("export OPENSHIFT_CLUSTER_SUBNET=%s", clusterNetworkCIDR)
err = ioutil.WriteFile("/run/openshift-sdn/config.env", []byte(config), 0644)
if err != nil {
