Skip to content

chore(lint): configure modernize linter#6035

Merged
k8s-ci-robot merged 7 commits intokubernetes-sigs:masterfrom
gofogo:fix-modernize
Dec 27, 2025
Merged

chore(lint): configure modernize linter#6035
k8s-ci-robot merged 7 commits intokubernetes-sigs:masterfrom
gofogo:fix-modernize

Conversation

@ivankatliarchuk
Copy link
Copy Markdown
Member

@ivankatliarchuk ivankatliarchuk commented Dec 18, 2025

What does it do ?

New linter added in version 2.6 https://golangci-lint.run/docs/linters/configuration/#modernize

Example linter in action https://github.com/kubernetes-sigs/external-dns/actions/runs/20321308179/job/58377426788?pr=6035

All changes done by linter itself -> make go-linter

Screenshot 2025-12-19 at 13 56 15

Motivation

Medium article https://ville.dev/blog/posts/go-modernize/

More

  • Yes, this PR title follows Conventional Commits
  • Yes, I added unit tests
  • Yes, I updated end user documentation accordingly

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 18, 2025
@ivankatliarchuk ivankatliarchuk marked this pull request as draft December 18, 2025 00:13
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 18, 2025
@coveralls
Copy link
Copy Markdown

coveralls commented Dec 18, 2025

Pull Request Test Coverage Report for Build 20537333048

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 213 unchanged lines in 8 files lost coverage.
  • Overall coverage decreased (-0.008%) to 78.545%

Files with Coverage Reduction New Missed Lines %
rfc2136/rfc2136.go 5 60.9%
txt.go 7 95.27%
aws/aws.go 8 90.64%
inmemory/inmemory.go 9 82.56%
ns1/ns1.go 11 76.4%
dynamodb.go 23 86.35%
gloo_proxy.go 41 73.6%
alibabacloud/alibaba_cloud.go 109 63.96%
Totals Coverage Status
Change from base Build 20524930726: -0.008%
Covered Lines: 15881
Relevant Lines: 20219

💛 - Coveralls

Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
@k8s-ci-robot k8s-ci-robot added the scripts Issues or PRs related to internal scripts label Dec 18, 2025
@k8s-ci-robot k8s-ci-robot added github_actions Pull requests that update GitHub Actions code apis Issues or PRs related to API change internal Issues or PRs related to internal code provider Issues or PRs related to a provider registry Issues or PRs related to a registry source size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 19, 2025
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
@ivankatliarchuk ivankatliarchuk marked this pull request as ready for review December 19, 2025 14:09
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 19, 2025
@k8s-ci-robot k8s-ci-robot requested a review from vflaux December 19, 2025 14:09
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 27, 2025
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 27, 2025
Signed-off-by: ivan katliarchuk <ivan.katliarchuk@gmail.com>
Comment on lines +458 to 463
for i := range endpoints {
if !endpoints[i].CheckEndpoint() {
log.Warnf("Ignoring Endpoint because of invalid %v record formatting: {Target: '%v'}", endpoints[i].RecordType, endpoints[i].Targets)
continue
}
validEndpoints = append(validEndpoints, endpoints[i])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wdyt of something like this ?

	for _, endpoint := range endpoints {
		if !endpoint.CheckEndpoint() {
			log.Warnf("Ignoring Endpoint because of invalid %v record formatting: {Target: '%v'}", endpoint.RecordType, endpoint.Targets)
			continue
		}
		validEndpoints = append(validEndpoints, endpoint)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is automated changes, aka make go-lint. I may need to create a follow-up for this

Copy link
Copy Markdown
Collaborator

@mloiseleur mloiseleur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
See my small suggestion.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 27, 2025
@ivankatliarchuk
Copy link
Copy Markdown
Member Author

/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ivankatliarchuk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 27, 2025
@k8s-ci-robot k8s-ci-robot merged commit a23f2d5 into kubernetes-sigs:master Dec 27, 2025
18 checks passed
ivankatliarchuk added a commit to gofogo/k8s-sigs-external-dns-fork that referenced this pull request Dec 28, 2025
* master:
  somehow single test was not fixed (kubernetes-sigs#6059)
  refactore(registry): move registry selector to registry package (kubernetes-sigs#6047)
  fix(domain-exclusion): domain exclusion filter fix (kubernetes-sigs#6050)
  chore(wrapper): centralized endpoint validation (kubernetes-sigs#6041)
  test(coverage): improve code coverage for different files (kubernetes-sigs#6045)
  chore(lint): configure modernize linter (kubernetes-sigs#6035)
  docs(proposal): Gateway API annotation placement clarity proposal (kubernetes-sigs#5919)
  fix(scripts): helm plugins install disable verify (kubernetes-sigs#6057)
  feat(cli): remove cobra cli support (kubernetes-sigs#6034)
  fix(chart): ptsc indentation (kubernetes-sigs#6054)
  chore(deps): bump renovatebot/github-action (kubernetes-sigs#6051)
  feat(aws): enable support for NAPTR records (kubernetes-sigs#6022)
  refactor: extract normalizeDNSName to idna package for reuse (kubernetes-sigs#6043)
@ivankatliarchuk ivankatliarchuk deleted the fix-modernize branch December 29, 2025 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

apis Issues or PRs related to API change approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. github_actions Pull requests that update GitHub Actions code internal Issues or PRs related to internal code lgtm "Looks good to me", indicates that a PR is ready to be merged. provider Issues or PRs related to a provider registry Issues or PRs related to a registry scripts Issues or PRs related to internal scripts size/L Denotes a PR that changes 100-499 lines, ignoring generated files. source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants