Skip to content

chore: use k8s.io/apimachinery/pkg/util/sets instead of map[string]struct{}#1848

Merged
AndrewChubatiuk merged 1 commit intomasterfrom
sets
Feb 24, 2026
Merged

chore: use k8s.io/apimachinery/pkg/util/sets instead of map[string]struct{}#1848
AndrewChubatiuk merged 1 commit intomasterfrom
sets

Conversation

@vrutkovs
Copy link
Collaborator

@vrutkovs vrutkovs commented Feb 24, 2026

util/sets package provides a better interface to handle sets

Fixed #1765


Summary by cubic

Replaced all map[string]struct{} “sets” with k8s.io/apimachinery/pkg/util/sets across the operator. This standardizes set ops (Has/Insert), reduces boilerplate, and keeps behavior the same.

  • Refactors
    • Switched disabled-controller tracking, flag parsing, and all “keep” lists to sets.Set[string] (services, scrapes, PDBs, HPAs, VPAs, STSs, Deployments).
    • Updated ChildCleaner and RemoveOrphaned* function signatures/tests to use sets; simplified delete checks to Has.
    • Used sets in reconcile mergeMaps (deleted keys) and StatefulSet validation (volume names).
    • Simplified IsControllerDisabled and manager disabled-controller checks with sets.

Written for commit 6288ab1. Summary will update on new commits.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 17 files

…ruct{}

util/sets package provides a better interface to handle sets
@AndrewChubatiuk AndrewChubatiuk merged commit df0fdf8 into master Feb 24, 2026
4 of 5 checks passed
@AndrewChubatiuk AndrewChubatiuk deleted the sets branch February 24, 2026 11:34
vrutkovs added a commit that referenced this pull request Mar 3, 2026
…ruct{} (#1848)

util/sets package provides a better interface to handle sets
AndrewChubatiuk pushed a commit that referenced this pull request Mar 3, 2026
…ruct{} (#1848)

util/sets package provides a better interface to handle sets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: use k8s.io/apimachinery/pkg/util/sets

2 participants