Use of Scope for routes in IPAM
Add Scope for routes for cni spec v1.1 Signed-off-by: Lionel Jouin <lionel.jouin@est.tech>
This commit is contained in:

committed by
Casey Callendrello

parent
01b3db8e01
commit
a6d6efa5ca
@ -123,8 +123,12 @@ func ConfigureIface(ifName string, res *current.Result) error {
|
||||
route.Table = *r.Table
|
||||
}
|
||||
|
||||
if r.Scope != nil {
|
||||
route.Scope = netlink.Scope(*r.Scope)
|
||||
}
|
||||
|
||||
if err = netlink.RouteAddEcmp(&route); err != nil {
|
||||
return fmt.Errorf("failed to add route '%v via %v dev %v (Table: %d)': %v", r.Dst, gw, ifName, route.Table, err)
|
||||
return fmt.Errorf("failed to add route '%v via %v dev %v (Scope: %v, Table: %d)': %v", r.Dst, gw, ifName, route.Scope, route.Table, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user