Skip to content

Refactor registerResourceInGatewayConfig to remove nolint:gocyclo - #5453

Merged
bjee19 merged 3 commits into
nginx:mainfrom
somaz94:feat/refactor-register-resource
Jun 24, 2026
Merged

bjee19 merged 3 commits into
nginx:mainfrom
somaz94:feat/refactor-register-resource

Conversation

@somaz94

@somaz94 somaz94 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

Problem: registerResourceInGatewayConfig carries a //nolint:gocyclo directive (#5253).

Solution: extract a getOrCreateNginxResources helper and collapse the eight repetitive ObjectMeta switch cases (Deployment, HPA, PDB, DaemonSet, Service, ServiceAccount, Role, RoleBinding) into single assignments. Behavior-preserving — no functional change (24 insertions / 62 deletions).

Validation:

  • golangci-lint: 0 issues (gocyclo < 15, nolint directive removed)
  • go test ./internal/controller/provisioner/...: pass
  • gofmt / go build: clean

related: #5253

NONE

@github-actions github-actions Bot added the enhancement New feature or request label Jun 16, 2026
somaz94 added a commit to somaz94/somaz94 that referenced this pull request Jun 16, 2026
@somaz94
somaz94 marked this pull request as ready for review June 19, 2026 02:44
@somaz94
somaz94 requested a review from a team as a code owner June 19, 2026 02:44
@bjee19
bjee19 enabled auto-merge (squash) June 22, 2026 22:49
@bjee19
bjee19 disabled auto-merge June 22, 2026 22:50
@bjee19
bjee19 enabled auto-merge (squash) June 22, 2026 22:50
@bjee19
bjee19 merged commit 93526a1 into nginx:main Jun 24, 2026
40 checks passed
@github-project-automation github-project-automation Bot moved this from 🆕 New to ✅ Done in NGINX Gateway Fabric Jun 24, 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