-
Notifications
You must be signed in to change notification settings - Fork 18
Use LabelSelector directly in namespaceSelector
#311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use LabelSelector directly in namespaceSelector
#311
Conversation
5a76c12 to
8694411
Compare
8694411 to
b8d198c
Compare
Signed-off-by: Dale Haiducek <[email protected]>
- Replace `matchLabels`/`matchExpressions` with `LabelSelector` for simplicity - Clean up variable declarations throughout Signed-off-by: Dale Haiducek <[email protected]>
b8d198c to
05ab225
Compare
| // If MatchLabels and MatchExpressions are nil, the resulting label selector | ||
| // matches all namespaces. This is to guard against that. | ||
| if t.LabelSelector == nil && len(t.Include) == 0 { | ||
| return []string{}, nil | ||
| } | ||
|
|
||
| labelSelector := parseToLabelSelector(t) | ||
| // List all namespaces by default, otherwise use provided LabelSelector | ||
| selector := labels.Everything() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently a nil LabelSelector matches no namespaces, so we have to make it explicit here now.
|
Flaky test failure 1; missing CSV: |
|
Flaky failure 2; missing expected compliance event: |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dhaiducek, mprahl The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
90571b0
into
open-cluster-management-io:main
matchLabels/matchExpressionswithLabelSelectorfor simplicity