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

Support "Clone API" to filter virtualmachine.spec.template.annotation… #10658

Merged
merged 1 commit into from Nov 22, 2023

Conversation

matthewei
Copy link
Contributor

What this PR does / why we need it:
The label--annotation-filters strip it from the top-level just as your description and it can't strip from spec.template.metadata.annotation or labels. Some cni such as kube-ovn will inject network information into the annotation. So we need to filter them out.

please theck the following example.

spec:
  # labels & annotations definitions
  labelFilters:
  - "*"
  - "!someKey/*"
  annotationFilters:
  - "anotherKey/*"

  template: # 
    labelFilters:
    - "*"
    - "!someKey/*"
    annotationFilters:
    - "anotherKey/*"

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #10374

Special notes for your reviewer:

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note:

1. Support "Clone API" to filter VirtualMachine.spec.template.annotation and VirtualMachine.spec.template.label

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Nov 1, 2023
@kubevirt-bot kubevirt-bot added size/L needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 1, 2023
@kubevirt-bot
Copy link
Contributor

Hi @matthewei. Thanks for your PR.

I'm waiting for a kubevirt member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@matthewei
Copy link
Contributor Author

/test

@kubevirt-bot
Copy link
Contributor

@matthewei: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test

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.

@matthewei
Copy link
Contributor Author

/ok-to-test

@kubevirt-bot
Copy link
Contributor

@matthewei: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/ok-to-test

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.

@matthewei
Copy link
Contributor Author

/needs-ok-test

@matthewei
Copy link
Contributor Author

matthewei commented Nov 6, 2023

@0xFelix hello, I make a few mistakes on the #10469 so I raise a new PR. Please move to next step.

@mhenriks
Copy link
Member

mhenriks commented Nov 8, 2023

/ok-to-test

@kubevirt-bot kubevirt-bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 8, 2023
@mhenriks
Copy link
Member

mhenriks commented Nov 8, 2023

/cc @mhenriks

@0xFelix
Copy link
Member

0xFelix commented Nov 8, 2023

/cc @0xFelix

Copy link
Member

@0xFelix 0xFelix left a comment

Choose a reason for hiding this comment

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

Looks OK to me but there are still failing tests. Can you please address those?

@@ -108,11 +114,12 @@ func validateFilters(filters []string, fieldName string) (causes []metav1.Status
return nil
}

errPattern := "%s filter %s is invalid: cannot contain a %s character (%s); FilterRules: %s"
Copy link
Member

Choose a reason for hiding this comment

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

nit: Keep definition of this at L129 and as const.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

get it!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

Can you put the changes to virtctl into a separate commit?

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, will do it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done ,will raise another PR

@mhenriks
Copy link
Member

/retest-required

@kubevirt-bot kubevirt-bot added dco-signoff: no Indicates the PR's author has not DCO signed all their commits. and removed dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Nov 14, 2023
@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. and removed dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels Nov 14, 2023
@matthewei
Copy link
Contributor Author

Looks OK to me but there are still failing tests. Can you please address those?

I will check the e2e code.

@matthewei matthewei force-pushed the cloneApiTemplateFilter branch 2 times, most recently from 3765ca6 to 321e5b7 Compare November 16, 2023 05:09
@matthewei
Copy link
Contributor Author

/retest-required

@matthewei matthewei force-pushed the cloneApiTemplateFilter branch 2 times, most recently from 3c29f05 to a39f1a5 Compare November 16, 2023 06:17
… or virtualmachine.spec.template.label

Signed-off-by: shenwei <shenwei_yewu@cmss.chinamobile.com>
@matthewei
Copy link
Contributor Author

matthewei commented Nov 17, 2023

/retest-required

@matthewei
Copy link
Contributor Author

If this PR can be merged and I would like to modify clone_api.

@matthewei
Copy link
Contributor Author

@0xFelix Hi, I have finished this PR. Please move to next step. Thanks a lot.

@mhenriks
Copy link
Member

/approve

@mhenriks
Copy link
Member

/retest-required

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mhenriks

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 20, 2023
@matthewei
Copy link
Contributor Author

matthewei commented Nov 21, 2023

can I raise a PR for clone_api?

Copy link
Member

@0xFelix 0xFelix left a comment

Choose a reason for hiding this comment

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

Thanks!

/lgtm
/retest-required

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 21, 2023
@0xFelix
Copy link
Member

0xFelix commented Nov 21, 2023

can I raise a PR for clone_api?

You mean a PR for updating the docs on the clone API? Please go ahead!

@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

2 similar comments
@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-bot
Copy link
Contributor

kubevirt-bot commented Nov 22, 2023

@matthewei: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubevirt-goveralls 0e7658d link false /test pull-kubevirt-goveralls
pull-kubevirt-check-tests-for-flakes 0e7658d link false /test pull-kubevirt-check-tests-for-flakes

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. I understand the commands that are listed here.

@kubevirt-commenter-bot
Copy link

/retest-required
This bot automatically retries required jobs that failed/flaked on approved PRs.
Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@kubevirt-bot kubevirt-bot merged commit 041d8b0 into kubevirt:main Nov 22, 2023
34 of 36 checks passed
@matthewei matthewei deleted the cloneApiTemplateFilter branch March 7, 2024 00:45
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support "Clone API" to filter VirtualMachine.spec.template.annotation and labels
5 participants