diff --git a/bcs-services/bcs-network/qcloud-eip/conf/conf.go b/bcs-services/bcs-network/qcloud-eip/conf/conf.go index 889ef9adb7..da14012eb1 100644 --- a/bcs-services/bcs-network/qcloud-eip/conf/conf.go +++ b/bcs-services/bcs-network/qcloud-eip/conf/conf.go @@ -45,10 +45,6 @@ type NetConf struct { UUID string `json:"uuid"` SubnetID string `json:"subnetId,omitempty"` MTU int `json:"mtu,omitempty"` - // Design: If both bridge network mode and elastic network card mode exist - // copy route to bridge into each eni route table, otherwise pod with eni can - // not communicate with the bridge-mode pod - BridgeName string `json:"bridgeName"` NetService *NetArgs `json:"netservice,omitempty"` Args *bcsconf.CNIArgs } diff --git a/bcs-services/bcs-network/qcloud-eip/eip/eip.go b/bcs-services/bcs-network/qcloud-eip/eip/eip.go index cc4828c66a..e87d4b8f79 100644 --- a/bcs-services/bcs-network/qcloud-eip/eip/eip.go +++ b/bcs-services/bcs-network/qcloud-eip/eip/eip.go @@ -232,25 +232,6 @@ func (eip *EIP) Init(file string, eniNum int, ipNum int) { blog.Errorf("add default route %v for table %d failed, err %s", defaultRouteRule, id, err.Error()) os.Exit(1) } - - // if bridgeName is not null, copy bridge route into each eni route table - if len(netConf.BridgeName) != 0 { - // get routes in main route table about bridge - bridgeRoutes, err := getBridgeRoutes(mainRouteTableID, netConf.BridgeName) - if err != nil { - blog.Warnf("get bridge %s routes failed, err %s", netConf.BridgeName) - continue - } - for _, r := range bridgeRoutes { - r.Table = id - blog.Info("add bridge route %+v for bridge %s", r, netConf.BridgeName) - err = netlink.RouteAdd(&r) - if err != nil { - blog.Errorf("add bridge route failed, err %s", err.Error()) - continue - } - } - } } // register ip pool for eni @@ -457,24 +438,6 @@ func (eip *EIP) Recover(file string, eniNum int) { blog.Errorf("add default route %v for table %d failed, err %s", defaultRouteRule, id, err.Error()) os.Exit(1) } - - // if bridgeName is not null, copy bridge route into each eni route table - if len(netConf.BridgeName) != 0 { - bridgeRoutes, err := getBridgeRoutes(mainRouteTableID, netConf.BridgeName) - if err != nil { - blog.Warnf("get bridge %s routes failed, err %s", netConf.BridgeName) - continue - } - for _, r := range bridgeRoutes { - r.Table = id - blog.Info("add bridge route %+v for bridge %s", r, netConf.BridgeName) - err = netlink.RouteAdd(&r) - if err != nil { - blog.Errorf("add bridge route failed, err %s", err.Error()) - continue - } - } - } } blog.Infof("congratulations, node recovery successfully!") @@ -752,6 +715,7 @@ func configureHostNS(hostIfName string, ipNet *net.IPNet, routeTableID int) erro ruleToTable := netlink.NewRule() ruleToTable.Dst = ipNet ruleToTable.Table = routeTableID + ruleToTable.Priority = 2048 err = netlink.RuleDel(ruleToTable) if err != nil { blog.Warnf("clean old rule to table %s failed, err %s", ruleToTable.String(), err.Error()) @@ -765,6 +729,7 @@ func configureHostNS(hostIfName string, ipNet *net.IPNet, routeTableID int) erro ruleFromTaskgroup := netlink.NewRule() ruleFromTaskgroup.Src = ipNet ruleFromTaskgroup.Table = routeTableID + ruleFromTaskgroup.Priority = 2048 err = netlink.RuleDel(ruleFromTaskgroup) if err != nil { blog.Warnf("clean old rule from taskgroup %s failed, err %s", ruleToTable.String(), err.Error())