Skip to content

refact: use Set structs instead of map[]struct{}#6360

Open
vflaux wants to merge 1 commit intokubernetes-sigs:masterfrom
vflaux:sets
Open

refact: use Set structs instead of map[]struct{}#6360
vflaux wants to merge 1 commit intokubernetes-sigs:masterfrom
vflaux:sets

Conversation

@vflaux
Copy link
Copy Markdown
Contributor

@vflaux vflaux commented Apr 9, 2026

What does it do ?

Use k8s.io/utils/set or k8s.io/apimachinery/pkg/util/sets.Set or instead of map[]struct{}.

k8s.io/utils/set is restricted in accepted types while k8s.io/apimachinery/pkg/util/sets.Set is not.
k8s.io/utils/set provide a SortedList() method which is useful in some cases with String sets.

Motivation

While map[]struct{} is idiomatic to implement a set, it's clearer and more readable to use a dedicated Set struct.

More

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

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ivankatliarchuk for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 9, 2026
@k8s-ci-robot k8s-ci-robot requested a review from mloiseleur April 9, 2026 17:18
@k8s-ci-robot k8s-ci-robot added controller Issues or PRs related to the controller 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. labels Apr 9, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

@vflaux: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-external-dns-unit-test af1e25f link true /test pull-external-dns-unit-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. controller Issues or PRs related to the controller provider Issues or PRs related to a provider registry Issues or PRs related to a registry 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.

2 participants