add cli for create/view restore resource policies#9966
Merged
Conversation
👷 Deploy request for velero pending review.Visit the deploys page to approve it
|
adam-jian-zhang
force-pushed
the
restore_filters_cli
branch
2 times, most recently
from
July 7, 2026 03:05
3cc3dbd to
8ae0c92
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds restore-side CLI support for referencing a resource policy ConfigMap during restore creation, and surfaces that reference in velero restore describe, aligning restore behavior with existing resource-policy mechanisms used elsewhere in Velero.
Changes:
- Adds
--resource-policies-configmaptovelero restore createand populatesRestoreSpec.ResourcePolicy. - Updates
velero restore describeoutput to include the restore’sResourcePolicyreference (when set). - Extends restore create CLI tests and adds an unreleased changelog entry.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| pkg/cmd/util/output/restore_describer.go | Prints resource policy reference during restore describe when configured. |
| pkg/cmd/cli/restore/create.go | Adds restore-create flag and wires it into RestoreSpec.ResourcePolicy; updates CLI help text. |
| pkg/cmd/cli/restore/create_test.go | Adds coverage for setting ResourcePolicy via the new CLI flag. |
| changelogs/unreleased/9966-adam-jian-zhang | Adds changelog entry for the new restore resource policy CLI support. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Added CLI for creating restore resource policies, and view the resource policies associated with resource if present. Only list the name of the configmap for now. Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
adam-jian-zhang
force-pushed
the
restore_filters_cli
branch
from
July 7, 2026 03:23
8ae0c92 to
19fb4a4
Compare
blackpiglet
approved these changes
Jul 7, 2026
kaovilai
approved these changes
Jul 10, 2026
3 tasks
adam-jian-zhang
added a commit
that referenced
this pull request
Jul 16, 2026
Added CLI for creating restore resource policies, and view the resource policies associated with resource if present. Only list the name of the configmap for now. Signed-off-by: Adam Zhang <adam.zhang@broadcom.com>
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.
Added CLI for creating restore resource policies, and view the resource policies associated with resource if present. Only list the name of the configmap for now.
Thank you for contributing to Velero!
Please add a summary of your change
Does your change fix a particular issue?
Fixes #(issue)
#9937
Please indicate you've done the following:
make new-changelog) or comment/kind changelog-not-requiredon this PR.site/content/docs/main.