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

Include --annotations flag in backup and restore create commands #8354

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

alromeros
Copy link
Contributor

@alromeros alromeros commented Oct 28, 2024

Thank you for contributing to Velero!

Please add a summary of your change

This Pull Request implements a new --annotations flag in the backup and restore create commands.

This allows users to specify key-value pairs for annotations directly at the time of backup and restore creation, in the same way as the --labels flag.

Usage example:

velero backup create my-backup --include-namespaces default --annotations AnnMetadataBackup=true

For restore:

velero restore create my-restore --include-namespaces default --annotations AnnIgnoreChecks=true

Does your change fix a particular issue?

Fixes #8350

Please indicate you've done the following:

This commit implements a new --annotations flag in the backup and restore create commands.

This allows users to specify key-value pairs for annotations directly at the time of backup and restore creation, in the same way as the --labels flag.

Signed-off-by: Alvaro Romero <[email protected]>
@alromeros alromeros force-pushed the add-annotations-flag branch from 5b4706f to e2839bb Compare October 28, 2024 09:08
@alromeros alromeros marked this pull request as ready for review October 28, 2024 09:10
Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.98%. Comparing base (8320df4) to head (e2839bb).
Report is 8 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8354   +/-   ##
=======================================
  Coverage   58.97%   58.98%           
=======================================
  Files         367      367           
  Lines       38876    38881    +5     
=======================================
+ Hits        22928    22933    +5     
  Misses      14486    14486           
  Partials     1462     1462           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@reasonerjt reasonerjt merged commit d0cffa3 into vmware-tanzu:main Nov 5, 2024
48 checks passed
@draghuram
Copy link
Contributor

I know it is a bit old but I couldn't tell what the PR does. AFAICT, backup/restore CRs don't support resource selection by annotations so what exactly is the result of passing this option to "create" commands? I am sure I missing something here.

@sseago
Copy link
Collaborator

sseago commented Nov 25, 2024

@draghuram this doesn't have anything to do with resource selection. This simply allows the user to add annotations to the backup CR -- without this PR, the use case here would require manually creating the backup CR via kubectl create.

As noted on the related issue, the more specific use case is "a third-party BackupItemAction plugin modifies its behavior based on annotations on the Backup CR, this PR allows those annotations to be set via velero backup create so the user is able to use the Velero CLI rather than being forced to use kubectl create and specifying the backup CR yaml manually.

@draghuram
Copy link
Contributor

Thanks, it is clear now.

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.

Backup: Add annotations via client
6 participants