Skip to content
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

🐛 Cache: Fix label defaulting of byObject when namespaces are configured #2805

Merged
merged 1 commit into from
May 1, 2024

Conversation

alvaroaleman
Copy link
Member

Currently, if there are global namespaces configured and no per-object namesapces, while there is both a global and a per-object labelSelector, we will:

  1. Default the namespaces labelSelector from DefaultLabelSelector
  2. Copy the namespaces including config into byObject.Namespaces

And thus end up with the global labelSelector overriding the per-object one, this change fixes that by swapping step 1 and 2.

Fixes #2804

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 1, 2024
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 1, 2024
Currently, if there are global namespaces configured and no per-object
namesapces, while there is both a global and a per-object labelSelector,
we will:
1. Default the namespaces labelSelector from `DefaultLabelSelector`
2. Copy the namespaces including config into `byObject.Namespaces`

And thus end up with the global labelSelector overriding the per-object
one, this change fixes that by swapping step 1 and 2.
@alvaroaleman
Copy link
Member Author

/cherrypick release-0.17
/cherrypick release-0.18

@k8s-infra-cherrypick-robot

@alvaroaleman: once the present PR merges, I will cherry-pick it on top of release-0.17 in a new PR and assign it to you.

In response to this:

/cherrypick release-0.17
/cherrypick release-0.18

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/test-infra repository.

@alvaroaleman
Copy link
Member Author

/cherrypick release-0.18

@k8s-infra-cherrypick-robot

@alvaroaleman: once the present PR merges, I will cherry-pick it on top of release-0.18 in a new PR and assign it to you.

In response to this:

/cherrypick release-0.18

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 1, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, vincepri

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:
  • OWNERS [alvaroaleman,vincepri]

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
Copy link
Contributor

LGTM label has been added.

Git tree hash: 1e782c1e6f0742c2788bfa2c7303d6fb0fdabac7

@k8s-ci-robot k8s-ci-robot merged commit d9f479e into kubernetes-sigs:main May 1, 2024
9 checks passed
@k8s-infra-cherrypick-robot

@alvaroaleman: new pull request created: #2807

In response to this:

/cherrypick release-0.17
/cherrypick release-0.18

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/test-infra repository.

@k8s-infra-cherrypick-robot

@alvaroaleman: new pull request created: #2808

In response to this:

/cherrypick release-0.18

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/test-infra repository.

@alvaroaleman alvaroaleman deleted the fix-cache-2 branch May 1, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DefaultLabelSelector overrides ByObject.Label in DefaultNamespaces
4 participants