Skip to content

Commit

Permalink
Always use 0 for NC version in Overlay (#1979)
Browse files Browse the repository at this point in the history
always use 0 for NC version in overlay

Signed-off-by: Evan Baker <[email protected]>
  • Loading branch information
rbtr authored Jun 14, 2023
1 parent 4a86b29 commit fe44297
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions cns/kubecontroller/nodenetworkconfig/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func CreateNCRequestFromDynamicNC(nc v1alpha.NetworkContainer) (*cns.CreateNetwo
//
//nolint:gocritic //ignore hugeparam
func CreateNCRequestFromStaticNC(nc v1alpha.NetworkContainer) (*cns.CreateNetworkContainerRequest, error) {
nc.Version = 0 // fix for NMA always giving us version 0 for Overlay NCs
primaryPrefix, err := netip.ParsePrefix(nc.PrimaryIP)
if err != nil {
return nil, errors.Wrapf(err, "IP: %s", nc.PrimaryIP)
Expand Down
10 changes: 5 additions & 5 deletions cns/kubecontroller/nodenetworkconfig/conversion_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

var validOverlayRequest = &cns.CreateNetworkContainerRequest{
Version: strconv.FormatInt(version, 10),
Version: strconv.FormatInt(0, 10),
IPConfiguration: cns.IPConfiguration{
IPSubnet: cns.IPSubnet{
PrefixLength: uint8(subnetPrefixLen),
Expand All @@ -19,19 +19,19 @@ var validOverlayRequest = &cns.CreateNetworkContainerRequest{
SecondaryIPConfigs: map[string]cns.SecondaryIPConfig{
"10.0.0.0": {
IPAddress: "10.0.0.0",
NCVersion: version,
NCVersion: 0,
},
"10.0.0.1": {
IPAddress: "10.0.0.1",
NCVersion: version,
NCVersion: 0,
},
"10.0.0.2": {
IPAddress: "10.0.0.2",
NCVersion: version,
NCVersion: 0,
},
"10.0.0.3": {
IPAddress: "10.0.0.3",
NCVersion: version,
NCVersion: 0,
},
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

var validOverlayRequest = &cns.CreateNetworkContainerRequest{
Version: strconv.FormatInt(version, 10),
Version: strconv.FormatInt(0, 10),
IPConfiguration: cns.IPConfiguration{
IPSubnet: cns.IPSubnet{
PrefixLength: uint8(subnetPrefixLen),
Expand Down

0 comments on commit fe44297

Please sign in to comment.