Incorporate Casey's comments
This commit is contained in:
@ -30,12 +30,9 @@ import (
|
|||||||
// The top-level network config - IPAM plugins are passed the full configuration
|
// The top-level network config - IPAM plugins are passed the full configuration
|
||||||
// of the calling plugin, not just the IPAM section.
|
// of the calling plugin, not just the IPAM section.
|
||||||
type Net struct {
|
type Net struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
CNIVersion string `json:"cniVersion"`
|
CNIVersion string `json:"cniVersion"`
|
||||||
IPAM *IPAMConfig `json:"ipam"`
|
IPAM *IPAMConfig `json:"ipam"`
|
||||||
RuntimeConfig struct {
|
|
||||||
Addresses []Address `json:"addresses,omitempty"`
|
|
||||||
} `json:"runtimeConfig,omitempty"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type IPAMConfig struct {
|
type IPAMConfig struct {
|
||||||
@ -87,10 +84,6 @@ func LoadIPAMConfig(bytes []byte, envArgs string) (*IPAMConfig, string, error) {
|
|||||||
return nil, "", fmt.Errorf("IPAM config missing 'ipam' key")
|
return nil, "", fmt.Errorf("IPAM config missing 'ipam' key")
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(n.RuntimeConfig.Addresses) != 0 {
|
|
||||||
n.IPAM.Addresses = append(n.RuntimeConfig.Addresses, n.IPAM.Addresses...)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Validate all ranges
|
// Validate all ranges
|
||||||
numV4 := 0
|
numV4 := 0
|
||||||
numV6 := 0
|
numV6 := 0
|
||||||
|
Reference in New Issue
Block a user