Skip to content

Refactor getResourceVersionForObject to remove nolint:gocyclo#5454

Open
somaz94 wants to merge 1 commit into
nginx:mainfrom
somaz94:feat/refactor-resource-version
Open

Refactor getResourceVersionForObject to remove nolint:gocyclo#5454
somaz94 wants to merge 1 commit into
nginx:mainfrom
somaz94:feat/refactor-resource-version

Conversation

@somaz94

@somaz94 somaz94 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

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

Solution: extract a resourceVersionIfNameMatches helper and collapse the eight repetitive ObjectMeta switch cases (Deployment, HPA, PDB, DaemonSet, Service, ServiceAccount, Role, RoleBinding) into single returns. Behavior-preserving — no functional change (18 insertions / 25 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
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: 🆕 New

Development

Successfully merging this pull request may close these issues.

1 participant