Describe the bug
In internal/webhook/nodereadinessgaterule_webhook.go, the
nodeSelectorsOverlap function uses string equality to detect overlapping
node selectors:
return sel1.String() == sel2.String()
This means two rules with different but overlapping selectors
(e.g. env=prod and env=prod,region=us) are not detected as
conflicting, even though both rules would match nodes labeled
env=prod,region=us and apply the same taint — causing conflicts.
Steps to reproduce
- Create rule A with nodeSelector
env=prod
- Create rule B with nodeSelector
env=prod,region=us and same taint key
- Webhook allows both rules despite overlapping selectors
- Both rules apply to nodes matching
env=prod,region=us
Expected behavior
Webhook should detect partial selector overlaps and reject conflicting rules.
Actual behavior
Only identical selectors are detected. Partial overlaps are missed.
File
internal/webhook/nodereadinessgaterule_webhook.go line 127
Are you able to fix this issue?
Yes (I will propose a PR)
Describe the bug
In
internal/webhook/nodereadinessgaterule_webhook.go, thenodeSelectorsOverlapfunction uses string equality to detect overlappingnode selectors:
This means two rules with different but overlapping selectors
(e.g.
env=prodandenv=prod,region=us) are not detected asconflicting, even though both rules would match nodes labeled
env=prod,region=usand apply the same taint — causing conflicts.Steps to reproduce
env=prodenv=prod,region=usand same taint keyenv=prod,region=usExpected behavior
Webhook should detect partial selector overlaps and reject conflicting rules.
Actual behavior
Only identical selectors are detected. Partial overlaps are missed.
File
internal/webhook/nodereadinessgaterule_webhook.goline 127Are you able to fix this issue?
Yes (I will propose a PR)