Skip to content

Refactor TLS certificate reference resolver#5439

Merged
salonichf5 merged 4 commits into
nginx:mainfrom
somaz94:feat/refactor-tls-cert-refs-resolver
Jun 16, 2026
Merged

Refactor TLS certificate reference resolver#5439
salonichf5 merged 4 commits into
nginx:mainfrom
somaz94:feat/refactor-tls-cert-refs-resolver

Conversation

@somaz94

@somaz94 somaz94 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

Problem: createExternalReferencesForTLSSecretsResolver in internal/controller/state/graph/gateway_listener.go carried a //nolint:gocyclo directive and a FIXME(bjee19), called out in #5253 as gocyclo tech debt.

Solution: Decompose the listener resolver closure into three focused helpers — resolveTLSCertRef (single certificate ref resolution), certRefPermitted (ReferenceGrant permission predicate), and applyCertRefErrors (error aggregation into listener conditions). Behavior is preserved; the //nolint:gocyclo and FIXME(bjee19) are removed.

This is one slice of #5253 — the issue tracks ~14 such functions, so this PR uses related: rather than Closes to avoid auto-closing the umbrella issue.

Validation:

  • golangci-lint run ./internal/controller/state/graph/ — 0 issues (gocyclo satisfied)
  • go test ./internal/controller/state/graph/... — pass
  • gofmt / go vet / go build — clean

related: #5253

NONE

@github-actions github-actions Bot added the enhancement New feature or request label Jun 11, 2026
somaz94 added a commit to somaz94/somaz94 that referenced this pull request Jun 11, 2026
@somaz94 somaz94 marked this pull request as ready for review June 12, 2026 01:14
@somaz94 somaz94 requested a review from a team as a code owner June 12, 2026 01:14
@salonichf5 salonichf5 enabled auto-merge (squash) June 16, 2026 16:39
@salonichf5 salonichf5 merged commit 0140779 into nginx:main Jun 16, 2026
40 checks passed
@github-project-automation github-project-automation Bot moved this from 🆕 New to ✅ Done in NGINX Gateway Fabric Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

3 participants