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

Annotation and label selection in replacement targets #4229

Conversation

natasha41575
Copy link
Contributor

@natasha41575 natasha41575 commented Oct 7, 2021

Adds support for annotation and label selection in replacement targets.

Fixes #4223

/cc @monopole
/cc @KnVerey

ALLOW_MODULE_SPAN

@k8s-ci-robot
Copy link
Contributor

@natasha41575: This PR has multiple commits, and the default merge method is: merge.
You can request commits to be squashed using the label: tide/merge-method-squash

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 cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 7, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: natasha41575

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 7, 2021
@natasha41575
Copy link
Contributor Author

/retest

@natasha41575
Copy link
Contributor Author

kind ping @KnVerey @monopole

@natasha41575 natasha41575 added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 3, 2021
@natasha41575
Copy link
Contributor Author

Added the hold label just so that @yuwenma can take a look and LGTM without it being merged automatically

func rejectId(rejects []*types.Selector, id *resid.ResId) bool {
for _, r := range rejects {
if id.IsSelectedBy(r.ResId) {
if !r.ResId.IsEmpty() && id.IsSelectedBy(r.ResId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this reason this can be empty now that the rejection may have been defined by selector (handled elsewhere) instead of by GVK? Does one of the existing tests cover the regression if we were to not do this check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I added this condition specifically because the reject via labelSelector test was failing without it.

kyaml/resid/resid.go Show resolved Hide resolved
@natasha41575 natasha41575 force-pushed the annotationAndLabelSelectionInReplacements branch from cdfa337 to ef5f1d3 Compare November 4, 2021 19:25
@KnVerey
Copy link
Contributor

KnVerey commented Nov 4, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 4, 2021
@natasha41575 natasha41575 removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 4, 2021
@k8s-ci-robot k8s-ci-robot merged commit 37ab557 into kubernetes-sigs:master Nov 4, 2021
@KnVerey KnVerey mentioned this pull request Mar 15, 2023
2 tasks
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support annotation and label selection in replacement targets
3 participants