include 0th address when parsing overlay cidrs (#1365)
Signed-off-by: Evan Baker <rbtr@users.noreply.github.com>
This commit is contained in:
Родитель
8750b346ed
Коммит
a8cf7a243a
|
@ -88,8 +88,7 @@ func CreateNCRequestFromStaticNC(nc v1alpha.NetworkContainer) (*cns.CreateNetwor
|
|||
|
||||
// iterate through all IP addresses in the subnet described by primaryPrefix and
|
||||
// add them to the request as secondary IPConfigs.
|
||||
zeroAddr := primaryPrefix.Masked().Addr() // the masked address is the 0th IP in the subnet
|
||||
for addr := zeroAddr.Next(); primaryPrefix.Contains(addr); addr = addr.Next() {
|
||||
for addr := primaryPrefix.Masked().Addr(); primaryPrefix.Contains(addr); addr = addr.Next() {
|
||||
secondaryIPConfigs[addr.String()] = cns.SecondaryIPConfig{
|
||||
IPAddress: addr.String(),
|
||||
NCVersion: int(nc.Version),
|
||||
|
|
|
@ -94,6 +94,10 @@ var validOverlayRequest = &cns.CreateNetworkContainerRequest{
|
|||
NetworkContainerid: ncID,
|
||||
NetworkContainerType: cns.Docker,
|
||||
SecondaryIPConfigs: map[string]cns.SecondaryIPConfig{
|
||||
"10.0.0.0": {
|
||||
IPAddress: "10.0.0.0",
|
||||
NCVersion: version,
|
||||
},
|
||||
"10.0.0.1": {
|
||||
IPAddress: "10.0.0.1",
|
||||
NCVersion: version,
|
||||
|
|
Загрузка…
Ссылка в новой задаче