From dc7a21164f13ea11af9a54cd75ac579433a5448c Mon Sep 17 00:00:00 2001 From: andrewwhitecdw Date: Thu, 13 Aug 2026 18:41:21 -0500 Subject: [PATCH] fix: IPv4 /31 gateway index in 3-tier literal is wrong Signed-off-by: andrewwhitecdw --- pkg/networkoperatorplugin/spectrumx/addressing.go | 2 +- pkg/networkoperatorplugin/spectrumx/addressing_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/networkoperatorplugin/spectrumx/addressing.go b/pkg/networkoperatorplugin/spectrumx/addressing.go index a335cf58..ebc1eba9 100644 --- a/pkg/networkoperatorplugin/spectrumx/addressing.go +++ b/pkg/networkoperatorplugin/spectrumx/addressing.go @@ -592,7 +592,7 @@ func poolSettings(spcx *config.ProfileSpectrumX) cidrPoolSettings { } } return cidrPoolSettings{ - gatewayIndex: 0, + gatewayIndex: 1, perNodeNetworkPrefix: 31, perNodeExclusions: []PerNodeExclusion{{StartIndex: 1, EndIndex: 1}}, } diff --git a/pkg/networkoperatorplugin/spectrumx/addressing_test.go b/pkg/networkoperatorplugin/spectrumx/addressing_test.go index 159c8de6..4ae1c093 100644 --- a/pkg/networkoperatorplugin/spectrumx/addressing_test.go +++ b/pkg/networkoperatorplugin/spectrumx/addressing_test.go @@ -98,7 +98,7 @@ func TestBuildCIDRPools2TierSWPLB(t *testing.T) { require.Len(t, pools, 4) require.Equal(t, "rail-0-plane-0-gpu-model", pools[0].Name) require.Equal(t, "172.16.0.0/18", pools[0].CIDR) - require.Equal(t, 0, pools[0].GatewayIndex) + require.Equal(t, 1, pools[0].GatewayIndex) require.Equal(t, 31, pools[0].PerNodeNetworkPrefix) require.Equal(t, []PerNodeExclusion{{StartIndex: 1, EndIndex: 1}}, pools[0].PerNodeExclusions) require.Equal(t, []string{"172.16.0.0/18", "172.16.0.0/14"}, pools[0].Routes) @@ -142,7 +142,7 @@ func TestBuildCIDRPools3Tier(t *testing.T) { require.Equal(t, []CIDRPool{{ Name: "rail-0", CIDR: "10.0.0.0/13", - GatewayIndex: 0, + GatewayIndex: 1, PerNodeNetworkPrefix: 31, PerNodeExclusions: []PerNodeExclusion{{StartIndex: 1, EndIndex: 1}}, Routes: []string{ @@ -247,7 +247,7 @@ func TestBuildCIDRPoolsFromAIR3Tier(t *testing.T) { require.Equal(t, []CIDRPool{{ Name: "rail-1", CIDR: "10.8.0.0/13", - GatewayIndex: 0, + GatewayIndex: 1, PerNodeNetworkPrefix: 31, PerNodeExclusions: []PerNodeExclusion{{StartIndex: 1, EndIndex: 1}}, Routes: []string{"10.8.0.0/13", "10.0.0.0/10"},