Skip to content

Add support for IPv6 #2190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 28 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5afe069
add support for ipv6
salonichf5 Jul 2, 2024
1fe7bb1
Update apis/v1alpha1/nginxproxy_types.go
salonichf5 Jul 8, 2024
caafe33
updates based on reviews
salonichf5 Jul 9, 2024
6c96e94
edit kind cluster creation with dual stack
salonichf5 Jul 9, 2024
0a5ead0
fix fieldalignment
salonichf5 Jul 9, 2024
8a930d7
updates based on reviews
salonichf5 Jul 10, 2024
2f03c33
update unit test
salonichf5 Jul 10, 2024
a19793c
update endpoint verification based on NGINX IP Family
salonichf5 Jul 11, 2024
5600726
update resolver
salonichf5 Jul 11, 2024
ec86322
update nginx proxy validator for ipFamily
salonichf5 Jul 11, 2024
5f6f583
add conditions to service
salonichf5 Jul 12, 2024
5b38ff9
improve verify IPFamily
salonichf5 Jul 12, 2024
b3dcc2c
Update internal/mode/static/state/resolver/resolver_test.go
salonichf5 Jul 12, 2024
c804274
Update internal/mode/static/nginx/config/upstreams_test.go
salonichf5 Jul 12, 2024
a578387
Update internal/mode/static/nginx/config/servers.go
salonichf5 Jul 12, 2024
624fd81
Update internal/mode/static/state/dataplane/configuration_test.go
salonichf5 Jul 12, 2024
de05457
Update internal/mode/static/state/graph/backend_refs.go
salonichf5 Jul 12, 2024
fe42fa5
Update internal/mode/static/state/graph/backend_refs.go
salonichf5 Jul 12, 2024
82584b2
Update internal/mode/static/state/graph/backend_refs.go
salonichf5 Jul 12, 2024
931c613
Update internal/mode/static/state/graph/backend_refs_test.go
salonichf5 Jul 12, 2024
2d1938c
Update internal/mode/static/state/graph/backend_refs_test.go
salonichf5 Jul 12, 2024
efe7fa1
address comments
salonichf5 Jul 12, 2024
4175da4
update compat doc and troubleshooting guide
salonichf5 Jul 14, 2024
e3c1b57
update doc
salonichf5 Jul 15, 2024
2ea4db6
update troubleshooting guide
salonichf5 Jul 15, 2024
b52b90d
update based on reviews
salonichf5 Jul 15, 2024
9ef4868
move service name creation out of function
salonichf5 Jul 16, 2024
e802e82
address comments
salonichf5 Jul 16, 2024
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
Prev Previous commit
Next Next commit
update nginx proxy validator for ipFamily
  • Loading branch information
salonichf5 committed Jul 17, 2024
commit ec8632211446ddc5900c443972a71d1102f58b42
16 changes: 16 additions & 0 deletions internal/mode/static/state/graph/nginxproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,21 @@ func validateNginxProxy(
}
}

if npCfg.Spec.IPFamily != nil {
ipFamily := npCfg.Spec.IPFamily
ipFamilyPath := spec.Child("ipFamily")
switch *ipFamily {
case ngfAPI.Dual,
ngfAPI.IPv4,
ngfAPI.IPv6:
default:
allErrs = append(allErrs, field.NotSupported(
ipFamilyPath,
ipFamily,
[]string{string(ngfAPI.Dual), string(ngfAPI.IPv4), string(ngfAPI.IPv6)}),
)
}
}

return allErrs
}
13 changes: 13 additions & 0 deletions internal/mode/static/state/graph/nginxproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ func TestValidateNginxProxy(t *testing.T) {
{Key: "key", Value: "value"},
},
},
IPFamily: helpers.GetPointer[ngfAPI.IPFamilyType](ngfAPI.Dual),
},
},
expectErrCount: 0,
Expand Down Expand Up @@ -326,6 +327,18 @@ func TestValidateNginxProxy(t *testing.T) {
expErrSubstring: "telemetry.spanAttributes",
expectErrCount: 2,
},
{
name: "invalid ipFamily type",
validator: createInvalidValidator(),
np: &ngfAPI.NginxProxy{
Spec: ngfAPI.NginxProxySpec{
Telemetry: &ngfAPI.Telemetry{},
IPFamily: helpers.GetPointer[ngfAPI.IPFamilyType]("invalid"),
},
},
expErrSubstring: "spec.ipFamily",
expectErrCount: 1,
},
}

for _, test := range tests {
Expand Down