Conversation
Add exported PathModifier* constants for the four NGINX location modifiers (=, ^~, ~, ~*) and an exported NormalizePath function that strips optional whitespace between a modifier and its URI, so that '~ /api' and '~/api' compare equal. Add unexported pathModifierOf helper that returns the modifier string for a given path, used by the updated subroute validation logic. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Change ValidateVirtualServerRouteForVirtualServer to accept vsPaths []string instead of a single vsPath string. This allows a single VSR to be referenced by more than one VS regex route. The new validateVirtualServerRouteSubroutes logic handles four cases: - Standalone (len==0): no path constraint, duplicate-path check only - Exact (=): still requires exactly one subroute matching the VS path - Regex (~, ~*): bidirectional set-equality between VS paths and VSR subroutes, with spacing-duplicate detection - Prefix (/,^~): existing HasPrefix logic, now normalized Update all callers to pass []string; standalone ValidateVirtualServerRoute passes nil (unchanged standalone behaviour). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refactor buildVirtualServerRoutes into an orchestrator that runs two
passes over the VS route list:
Pass 1 (collectRegexVSRPaths): scan all VS routes for regex paths
referencing named VSRs, grouping normalized paths by VSR key. Spacing-
duplicate paths are warned upfront in detectSpacingDuplicateRegexPaths.
Non-regex VSRs are processed as before in buildNonRegexVSRs.
rejectMixedTypeVSRs removes any VSR referenced by both regex and non-
regex routes from both sets.
Pass 2 (validateAndBuildRegexVSRs): call
ValidateVirtualServerRouteForVirtualServer once per unique regex VSR,
passing the full set of collected VS paths. Only VSRs that pass
validation are included in the output.
deduplicateVSRs ensures a VSR appearing in multiple regex routes is
still included only once.
Update the two non-regex call sites to wrap r.Path in []string{}.
Add TestBuildVirtualServerRoutesMultipleRegex covering: two matching
regex routes, spacing-duplicate warning, orphaned subroute rejection,
uncovered VS path rejection, and mixed-type rejection.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add TestGenerateVirtualServerConfigForVSRWithMultipleRegexSubroutes to verify that GenerateVirtualServerConfig produces a separate nginx location block for each regex subroute when a single VSR is referenced by multiple VS regex routes. Checks that paths are correctly formatted by generatePath (~/api/v1 becomes ~ "/api/v1") and that each location is tagged IsVSR=true with the correct VSRName and VSRNamespace. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9621 +/- ##
==========================================
+ Coverage 55.28% 55.61% +0.33%
==========================================
Files 99 99
Lines 19749 19915 +166
==========================================
+ Hits 10918 11076 +158
- Misses 8224 8230 +6
- Partials 607 609 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Package ReportDetailsgcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx, 1.29.8-1~trixie, amd64gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-module-njs, 1.29.8+0.9.6-1~trixie, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-module-otel, 1.29.8+0.1.2-1~trixie, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-agent, 3.9.0~trixie, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx, 1.29.8-1~trixie, arm64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-module-njs, 1.29.8+0.9.6-1~trixie, arm64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-module-otel, 1.29.8+0.1.2-1~trixie, arm64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-agent, 3.9.0~trixie, arm64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus, 36-4~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-njs, 36+0.9.6-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-otel, 36+0.1.2-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-fips-check, 36+0.1-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-agent, 3.9.0~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus, 36-4~bookworm, arm64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-njs, 36+0.9.6-1~bookworm, arm64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-otel, 36+0.1.2-1~bookworm, arm64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-fips-check, 36+0.1-1~bookworm, arm64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-agent, 3.9.0~bookworm, arm64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus, 36-4~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-njs, 36+0.9.6-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-otel, 36+0.1.2-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-fips-check, 36+0.1-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-appprotect, 36+5.607.1-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, app-protect, 36+5.607.1-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, app-protect-attack-signatures, 2026.04.15-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, app-protect-threat-campaigns, 2026.04.14-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-agent, 2.46.1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus, 36-4~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-njs, 36+0.9.6-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-otel, 36+0.1.2-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-fips-check, 36+0.1-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-appprotect, 36+5.607.1-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, app-protect-module-plus, 36+5.607.1-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, app-protect-plugin, 6.28.0-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-agent, 2.46.1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus, 36-4~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-njs, 36+0.9.6-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-otel, 36+0.1.2-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-fips-check, 36+0.1-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-appprotectdos, 36+4.8.3-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, app-protect-dos, 36+4.8.3-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus, 36-4~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-njs, 36+0.9.6-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-otel, 36+0.1.2-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-fips-check, 36+0.1-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-appprotect, 36+5.607.1-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, app-protect, 36+5.607.1-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, app-protect-attack-signatures, 2026.04.15-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, app-protect-threat-campaigns, 2026.04.14-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-plus-module-appprotectdos, 36+4.8.3-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, app-protect-dos, 36+4.8.3-1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64, nginx-agent, 2.46.1~bookworm, amd64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx, 1.29.8-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-module-njs, 1.29.8.0.9.6-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-module-otel, 1.29.8.0.1.2-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-agent, 3.9.0, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx, 1.29.8-r1, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-module-njs, 1.29.8.0.9.6-r1, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-module-otel, 1.29.8.0.1.2-r1, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-agent, 3.9.0, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-plus, 36-r4, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-plus-module-njs, 36.0.9.6-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-plus-module-otel, 36.0.1.2-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-plus-module-fips-check, 36.0.1-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-agent, 3.9.0, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-plus, 36-r4, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-plus-module-njs, 36.0.9.6-r1, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-plus-module-otel, 36.0.1.2-r1, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-plus-module-fips-check, 36.0.1-r1, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine, nginx-agent, 3.9.0, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus, 36-r4, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus-module-njs, 36.0.9.6-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus-module-otel, 36.0.1.2-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus-module-fips-check, 36.0.1-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-agent, 3.9.0, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus, 36-r4, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus-module-njs, 36.0.9.6-r1, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus-module-otel, 36.0.1.2-r1, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus-module-fips-check, 36.0.1-r1, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-agent, 3.9.0, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus, 36-r4, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus-module-njs, 36.0.9.6-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus-module-otel, 36.0.1.2-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus-module-fips-check, 36.0.1-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-agent, 2.46.1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus-module-appprotect, 36.5.607.1-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, app-protect, 36.5.607.1-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, app-protect-attack-signatures, 2026.04.15-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, app-protect-threat-campaigns, 2026.04.14-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus, 36-r4, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus-module-njs, 36.0.9.6-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus-module-otel, 36.0.1.2-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus-module-fips-check, 36.0.1-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-agent, 2.46.1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, nginx-plus-module-appprotect, 36.5.607.1-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, app-protect-module-plus, 36.5.607.1-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-alpine-fips, app-protect-plugin, 6.28.0-r1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx, 1.29.8-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-module-njs, 1.29.8+0.9.6-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-module-otel, 1.29.8+0.1.2-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-agent, 3.9.0-1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx, 1.29.8-1.el9.ngx, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-module-njs, 1.29.8+0.9.6-1.el9.ngx, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-module-otel, 1.29.8+0.1.2-1.el9.ngx, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-agent, 3.9.0-1, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus, 36-4.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-njs, 36+0.9.6-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-otel, 36+0.1.2-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-fips-check, 36+0.1-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-agent, 3.9.0-1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus, 36-4.el9.ngx, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-njs, 36+0.9.6-1.el9.ngx, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-otel, 36+0.1.2-1.el9.ngx, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-fips-check, 36+0.1-1.el9.ngx, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-agent, 3.9.0-1, aarch64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus, 36-4.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-njs, 36+0.9.6-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-otel, 36+0.1.2-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-fips-check, 36+0.1-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-agent, 2.46.1-1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-appprotect, 36+5.607.1-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, app-protect, 36+5.607.1-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, app-protect-attack-signatures, 2026.04.15-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, app-protect-threat-campaigns, 2026.04.14-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus, 36-4.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-njs, 36+0.9.6-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-otel, 36+0.1.2-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-fips-check, 36+0.1-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-agent, 2.46.1-1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-appprotect, 36+5.607.1-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, app-protect-module-plus, 36+5.607.1-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, app-protect-plugin, 6.28.0-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, nginx-plus, 36-4.el8.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, nginx-plus-module-njs, 36+0.9.6-1.el8.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, nginx-plus-module-otel, 36+0.1.2-1.el8.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, nginx-plus-module-fips-check, 36+0.1-1.el8.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, nginx-agent, 2.46.1-1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, nginx-plus-module-appprotect, 36+5.607.1-1.el8.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, app-protect, 36+5.607.1-1.el8.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, app-protect-attack-signatures, 2026.04.15-1.el8.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, app-protect-threat-campaigns, 2026.04.14-1.el8.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, nginx-plus, 36-4.el8.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, nginx-plus-module-njs, 36+0.9.6-1.el8.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, nginx-plus-module-otel, 36+0.1.2-1.el8.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, nginx-plus-module-fips-check, 36+0.1-1.el8.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, nginx-agent, 2.46.1-1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, nginx-plus-module-appprotect, 36+5.607.1-1.el8.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, app-protect-module-plus, 36+5.607.1-1.el8.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-nap-v5/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi8, app-protect-plugin, 6.28.0-1.el8.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus, 36-4.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-njs, 36+0.9.6-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-otel, 36+0.1.2-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-fips-check, 36+0.1-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-appprotectdos, 36+4.8.3-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, app-protect-dos, 36+4.8.3-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus, 36-4.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-njs, 36+0.9.6-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-otel, 36+0.1.2-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-fips-check, 36+0.1-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-appprotect, 36+5.607.1-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-plus-module-appprotectdos, 36+4.8.3-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, nginx-agent, 2.46.1-1, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, app-protect, 36+5.607.1-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, app-protect-attack-signatures, 2026.04.15-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, app-protect-threat-campaigns, 2026.04.14-1.el9.ngx, x86_64 gcr.io/f5-gcs-7899-ptg-ingrss-ctlr/dev/nginx-ic-dos-nap/nginx-plus-ingress:t-e7728dcbc6227f1367fbe44ede14fe64-ubi, app-protect-dos, 36+4.8.3-1.el9.ngx, x86_64 |
…eSubroutes Extract four independent validation branches into separate methods: - validateSubroutesStandalone (complexity 4) - validateSubroutesExact (complexity 3) - validateSubroutesRegex (complexity 13) - validateSubroutesPrefix (complexity 6) The orchestrator is now a simple dispatcher (complexity 7). All functions are under the 15-complexity lint limit. No behaviour change; all existing tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR extends VirtualServer ↔ VirtualServerRoute (VSR) validation and routing so that multiple regex routes in a single VirtualServer can reference the same VSR, and the VSR’s spec.subroutes must match that collected set of regex paths (after normalization).
Changes:
- Update VSR validation to accept multiple VS route paths and enforce bidirectional set equality for regex path references.
- Add path normalization utilities and new validation/test coverage for multi-regex VSR usage.
- Refactor
buildVirtualServerRoutes()to group regex VS routes by VSR, validate them in a second pass, and warn on spacing-equivalent regex paths.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/apis/configuration/validation/virtualserver.go | Adds path normalization + refactors VSR subroute validation to support multiple VS regex paths per VSR. |
| pkg/apis/configuration/validation/virtualserver_test.go | Updates existing tests for the new validator signature and adds multi-regex validation cases. |
| internal/k8s/configuration.go | Refactors VSR collection/validation into regex vs non-regex passes; adds normalization warnings and helper utilities. |
| internal/k8s/configuration_test.go | Adds integration-style tests for buildVirtualServerRoutes() behavior with multi-regex VSR references. |
| internal/configs/virtualserver_routing_test.go | Verifies generated nginx locations for a VSR referenced by multiple regex VS routes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR extends VirtualServerRoute (VSR) handling so a single VSR can be referenced by multiple regex VirtualServer (VS) routes, with validation enforcing a bidirectional set match between VS regex paths and VSR subroutes (after path normalization).
Changes:
- Updated VSR validation APIs to accept a batch of VS route paths (vsPaths) and added path normalization helpers for NGINX location modifiers.
- Added a two-pass VS route build flow: collect/dedupe regex VS→VSR references, validate regex VSRs against the full set of VS paths, and reject mixed regex/non-regex references.
- Expanded unit tests to cover normalization, multi-regex references, and config generation for multiple regex subroutes.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/apis/configuration/validation/virtualserver.go | Adds path normalization + modifier helpers and updates VSR subroute validation to support multi-regex vsPaths. |
| pkg/apis/configuration/validation/virtualserver_test.go | Updates/expands validator tests to cover multi-path validation and normalization edge cases. |
| internal/k8s/configuration.go | Implements collection/deduping of regex VS route paths per VSR and pass-2 validation/build for regex-referenced VSRs. |
| internal/k8s/configuration_test.go | Adds integration-style tests for multi-regex VSR behavior and updates expected warning paths. |
| internal/configs/virtualserver_routing_test.go | Adds config-generation test ensuring multiple regex subroutes produce multiple NGINX regex locations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Proposed changes
Currently when a VS refers to a regex path and a VSR, that VSR can only ever contain that one route that matches exactly the VS definition.
The work in this PR is to allow a VS to have multiple regex routes that refer to the same VSR. That VSR then should have the same number of routes that also match. This would allow the following situations:
The checks that should happen:
~* /apiand*~/apiare not treated differently)And then there are a bunch of changes that allow the above:
This is still very much a draft PR, I want to have conversations whether the approach is good, whether the assumptions are sound, and whether things could live in better places.
Checklist
Before creating a PR, run through this checklist and mark each as complete.