|
1 | | -package network |
2 | | - |
3 | | -import ( |
4 | | - "net" |
5 | | - |
6 | | - "github.com/Azure/azure-container-networking/cni" |
7 | | - cniTypesCurr "github.com/containernetworking/cni/pkg/types/current" |
8 | | -) |
9 | | - |
10 | | -// IPAMInvoker is used by the azure-vnet CNI plugin to call different sources for IPAM. |
11 | | -// This interface can be used to call into external binaries, like the azure-vnet-ipam binary, |
12 | | -// or simply act as a client to an external ipam, such as azure-cns. |
13 | | -type IPAMInvoker interface { |
14 | | - |
15 | | - //Add returns two results, one IPv4, the other IPv6. |
16 | | - Add(nwCfg *cni.NetworkConfig, subnetPrefix *net.IPNet, options map[string]interface{}) (*cniTypesCurr.Result, *cniTypesCurr.Result, error) |
17 | | - |
18 | | - //Delete calls to the invoker source, and returns error. Returning an error here will fail the CNI Delete call. |
19 | | - Delete(address *net.IPNet, nwCfg *cni.NetworkConfig, options map[string]interface{}) error |
20 | | -} |
| 1 | +package network |
| 2 | + |
| 3 | +import ( |
| 4 | + "net" |
| 5 | + |
| 6 | + "github.com/Azure/azure-container-networking/cni" |
| 7 | + cniTypesCurr "github.com/containernetworking/cni/pkg/types/current" |
| 8 | +) |
| 9 | + |
| 10 | +// IPAMInvoker is used by the azure-vnet CNI plugin to call different sources for IPAM. |
| 11 | +// This interface can be used to call into external binaries, like the azure-vnet-ipam binary, |
| 12 | +// or simply act as a client to an external ipam, such as azure-cns. |
| 13 | +type IPAMInvoker interface { |
| 14 | + |
| 15 | + //Add returns two results, one IPv4, the other IPv6. |
| 16 | + Add(nwCfg *cni.NetworkConfig, subnetPrefix *net.IPNet, options map[string]interface{}) (*cniTypesCurr.Result, *cniTypesCurr.Result, error) |
| 17 | + |
| 18 | + //Delete calls to the invoker source, and returns error. Returning an error here will fail the CNI Delete call. |
| 19 | + Delete(address *net.IPNet, nwCfg *cni.NetworkConfig, options map[string]interface{}) error |
| 20 | +} |
0 commit comments