pkg,plugins: update for Result struct Interface index changes
It's a pointer now, so we need to use the helper function to set the field and also test for nil before accessing it.
This commit is contained in:
@ -100,7 +100,7 @@ func calcGateways(result *current.Result, n *NetConf) (*gwInfo, *gwInfo, error)
|
||||
defaultNet.Mask = net.IPMask(defaultNet.IP)
|
||||
|
||||
// All IPs currently refer to the container interface
|
||||
ipc.Interface = 2
|
||||
ipc.Interface = current.Int(2)
|
||||
|
||||
// If not provided, calculate the gateway address corresponding
|
||||
// to the selected IP address
|
||||
|
@ -159,7 +159,7 @@ func cmdAdd(args *skel.CmdArgs) error {
|
||||
}
|
||||
for _, ipc := range result.IPs {
|
||||
// All addresses belong to the ipvlan interface
|
||||
ipc.Interface = 0
|
||||
ipc.Interface = current.Int(0)
|
||||
}
|
||||
|
||||
result.Interfaces = []*current.Interface{ipvlanInterface}
|
||||
|
@ -179,7 +179,7 @@ func cmdAdd(args *skel.CmdArgs) error {
|
||||
|
||||
for _, ipc := range result.IPs {
|
||||
// All addresses apply to the container macvlan interface
|
||||
ipc.Interface = 0
|
||||
ipc.Interface = current.Int(0)
|
||||
}
|
||||
|
||||
err = netns.Do(func(_ ns.NetNS) error {
|
||||
|
@ -75,7 +75,7 @@ func setupContainerVeth(netns ns.NetNS, ifName string, mtu int, pr *current.Resu
|
||||
|
||||
for _, ipc := range pr.IPs {
|
||||
// All addresses apply to the container veth interface
|
||||
ipc.Interface = 1
|
||||
ipc.Interface = current.Int(1)
|
||||
}
|
||||
|
||||
pr.Interfaces = []*current.Interface{hostInterface, containerInterface}
|
||||
|
@ -148,7 +148,7 @@ func cmdAdd(args *skel.CmdArgs) error {
|
||||
}
|
||||
for _, ipc := range result.IPs {
|
||||
// All addresses belong to the vlan interface
|
||||
ipc.Interface = 0
|
||||
ipc.Interface = current.Int(0)
|
||||
}
|
||||
|
||||
result.Interfaces = []*current.Interface{vlanInterface}
|
||||
|
Reference in New Issue
Block a user