Skip to content

add cli for create/view restore resource policies#9966

Merged
kaovilai merged 1 commit into
velero-io:mainfrom
adam-jian-zhang:restore_filters_cli
Jul 10, 2026
Merged

add cli for create/view restore resource policies#9966
kaovilai merged 1 commit into
velero-io:mainfrom
adam-jian-zhang:restore_filters_cli

Conversation

@adam-jian-zhang

@adam-jian-zhang adam-jian-zhang commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

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:

@netlify

netlify Bot commented Jul 7, 2026

Copy link
Copy Markdown

👷 Deploy request for velero pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 19fb4a4

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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-configmap to velero restore create and populates RestoreSpec.ResourcePolicy.
  • Updates velero restore describe output to include the restore’s ResourcePolicy reference (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.

Comment thread pkg/cmd/cli/restore/create.go Outdated
Comment thread pkg/cmd/cli/restore/create.go Outdated
Comment thread pkg/cmd/cli/restore/create.go
Comment thread changelogs/unreleased/9966-adam-jian-zhang Outdated
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/cmd/util/output/restore_describer.go 0.00% 3 Missing ⚠️

📢 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>
@kaovilai
kaovilai merged commit c1cd00f into velero-io:main Jul 10, 2026
61 checks passed
@adam-jian-zhang
adam-jian-zhang deleted the restore_filters_cli branch July 10, 2026 13:54
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants