fix(lint): resolve goconst violations across packages#280
Merged
Conversation
Tune goconst to skip generic noise strings (true/false/Config/name) and bump min-occurrences to 4 so only repeats that clearly warrant a constant get flagged. Extract named constants for the meaningful repeats: Argo CD chart version and namespace, deployment names, kubeconfig exec args, the local-gitops volume name, longhorn webhook keys and node label, the default CIDR allowlist, and K3s defaults. Reuse the existing aws.ProviderName constant; add a parallel local.ProviderName.
CI's config verify rejects the regex string form; the schema requires an array of literal strings.
marcelovilla
approved these changes
May 5, 2026
Member
marcelovilla
left a comment
There was a problem hiding this comment.
LGTM @dcmcand! Thanks for taking care of this
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI's golangci-lint job has been failing on main since the goconst rules tightened in golangci-lint v2.12.1. This PR clears all 39 goconst issues so CI goes green.
.golangci.yml: bumpgoconst.min-occurrencesfrom the default 3 to 4, and addignore-string-values: ^(true|false|Config|name)$. Together these skip strings that are too incidental or too generic to meaningfully name as constants.argocd-serverdeployment name, thelocal-gitopsvolume name, the AWS IAM Authenticator kubeconfig exec args (eks,get-token,--cluster-name,--region,client.authentication.k8s.io/v1beta1), Longhorn webhook security-group keys and node label, the0.0.0.0/0default CIDR allowlist, and the local provider'sstandardStorageClass and MetalLB address pool defaults.aws.ProviderNamefor the kubeconfig exec command; add a matchinglocal.ProviderName.The lint failures are pre-existing on main (not introduced by any open PR), so this lands as a standalone fix.
Test plan
golangci-lint runreports 0 issues locally (v2.12.1)go build ./...succeedsgo test ./...passes