Skip to content

Commit 2203a52

Browse files
committed
Fix ipv6 cidr in tests
1 parent 8b97bae commit 2203a52

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

internal/mode/static/state/graph/nginxproxy_test.go

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ func TestValidateNginxProxy(t *testing.T) {
801801
TrustedAddresses: []ngfAPIv1alpha2.RewriteClientIPAddress{
802802
{
803803
Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType,
804-
Value: "2001:db8:a0b:12f0::1/32",
804+
Value: "2001:db8:a0b:12f0::1/128",
805805
},
806806
{
807807
Type: ngfAPIv1alpha2.RewriteClientIPIPAddressType,
@@ -925,7 +925,7 @@ func TestValidateRewriteClientIP(t *testing.T) {
925925
TrustedAddresses: []ngfAPIv1alpha2.RewriteClientIPAddress{
926926
{
927927
Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType,
928-
Value: "2001:db8:a0b:12f0::1/32",
928+
Value: "2001:db8:a0b:12f0::1/128",
929929
},
930930
{
931931
Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType,
@@ -1048,27 +1048,27 @@ func TestValidateRewriteClientIP(t *testing.T) {
10481048
RewriteClientIP: &ngfAPIv1alpha2.RewriteClientIP{
10491049
Mode: helpers.GetPointer(ngfAPIv1alpha2.RewriteClientIPModeProxyProtocol),
10501050
TrustedAddresses: []ngfAPIv1alpha2.RewriteClientIPAddress{
1051-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1052-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1053-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1054-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1055-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1056-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1057-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1058-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1059-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1060-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1061-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1062-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1063-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1064-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1065-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1066-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1067-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1068-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1069-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1070-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1071-
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1051+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1052+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1053+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1054+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1055+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1056+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1057+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1058+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1059+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1060+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1061+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1062+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1063+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1064+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1065+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1066+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1067+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1068+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1069+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1070+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
1071+
{Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
10721072
},
10731073
},
10741074
},
@@ -1086,7 +1086,7 @@ func TestValidateRewriteClientIP(t *testing.T) {
10861086
TrustedAddresses: []ngfAPIv1alpha2.RewriteClientIPAddress{
10871087
{
10881088
Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType,
1089-
Value: "2001:db8:a0b:12f0::1/32",
1089+
Value: "2001:db8:a0b:12f0::1/128",
10901090
},
10911091
{
10921092
Type: ngfAPIv1alpha2.RewriteClientIPCIDRAddressType,
@@ -1312,7 +1312,7 @@ func TestValidateNginxPlus(t *testing.T) {
13121312
NginxPlus: &ngfAPIv1alpha2.NginxPlus{
13131313
AllowedAddresses: []ngfAPIv1alpha2.NginxPlusAllowAddress{
13141314
{Type: ngfAPIv1alpha2.NginxPlusAllowIPAddressType, Value: "2001:db8:a0b:12f0::1"},
1315-
{Type: ngfAPIv1alpha2.NginxPlusAllowCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1315+
{Type: ngfAPIv1alpha2.NginxPlusAllowCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
13161316
{Type: ngfAPIv1alpha2.NginxPlusAllowIPAddressType, Value: "127.0.0.3"},
13171317
{Type: ngfAPIv1alpha2.NginxPlusAllowCIDRAddressType, Value: "127.0.0.3/32"},
13181318
},
@@ -1328,7 +1328,7 @@ func TestValidateNginxPlus(t *testing.T) {
13281328
Spec: ngfAPIv1alpha2.NginxProxySpec{
13291329
NginxPlus: &ngfAPIv1alpha2.NginxPlus{
13301330
AllowedAddresses: []ngfAPIv1alpha2.NginxPlusAllowAddress{
1331-
{Type: ngfAPIv1alpha2.NginxPlusAllowCIDRAddressType, Value: "2001:db8:a0b:12f0::1/32"},
1331+
{Type: ngfAPIv1alpha2.NginxPlusAllowCIDRAddressType, Value: "2001:db8:a0b:12f0::1/128"},
13321332
{Type: ngfAPIv1alpha2.NginxPlusAllowCIDRAddressType, Value: "127.0.0.3/37"},
13331333
},
13341334
},

0 commit comments

Comments
 (0)