restore filters via resource policy#9946
Open
adam-jian-zhang wants to merge 4 commits into
Open
Conversation
👷 Deploy request for velero pending review.Visit the deploys page to approve it
|
restore filters via resource policy, support ClusterScopedFilterPolicy and NamespaceFilterPolicies. Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
a014da0 to
b41e5df
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Lyndon-Li
reviewed
Jul 3, 2026
Lyndon-Li
previously approved these changes
Jul 6, 2026
kaovilai
reviewed
Jul 8, 2026
When a user specifies a Custom Resource Kind in a restore filter policy (e.g., kinds: [MyCustomKind]), the discovery helper fails to resolve it if the CRD hasn't been restored yet. This adds a peek-and-map fallback: if a resource type in the backup tarball doesn't match the resolved filters, Velero peeks at the actual Kind of the first item in the tarball and matches it against the user's original policy strings. Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
kaovilai
reviewed
Jul 8, 2026
Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
- normalized the input to lower case for consistency - added validations for kind collision - add flag for unresolved kinds, and defer skip decision base on that - move peek-and-map test cases to restore_policies_test.go Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
Collaborator
Author
|
Thanks @shubham-pampattiwar and @kaovilai for the detailed review, I have addressed all review comments, please take a look again, very appreciated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
restore filters via resource policy, support ClusterScopedFilterPolicy and NamespaceFilterPolicies.
Thank you for contributing to Velero!
Please add a summary of your change
Does your change fix a particular issue?
Fixes #(issue)
#9936
Please indicate you've done the following:
make new-changelog) or comment/kind changelog-not-requiredon this PR.site/content/docs/main.