Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cns/singletenantcontroller/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 4 additions & 0 deletions cns/singletenantcontroller/conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down