-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Allow annotations and/or labels on Backup objects to be added onto the backup object in plugins during a backup #2483
Comments
@jimbo459 It is definitely possible to add annotations or update the object to be backed un in a backupItemAction plugin. What you might be missing is the marshaling and un-marshaling steps performed at https://github.com/vmware-tanzu/velero-plugin-for-csi/blob/master/internal/backup/pvc_action.go#L65-L68 and https://github.com/vmware-tanzu/velero-plugin-for-csi/blob/master/internal/backup/pvc_action.go#L163-L166 respectively. If this doesn't solve your problem, please share a link to your code and we'll be happy to help further. |
Hey @ashish-amarnath Thanks for the update! We are trying to modify the In your examples I think the csi plugin is modifying From slack: https://kubernetes.slack.com/archives/C6VCGP4MT/p1588064584438000 it seems like this isn't a use-case that is expected to work. So we may try out the workaround suggested in the thread and update here if that works 👍 |
@neil-hickey Thanks for the update. I am going to close this issue. Feel free to re-open or engage w/ us on slack. |
Reopening as there are use cases where this may be useful for plugins to add annotations/labels. |
Need to figure out how to make this work as we moved the Kubernetes serializer into Astrolabe |
I need this feature with Argo CD, so that I can ignore the backup objects itself, but not the schedule |
I had this same issue and this is the solution I settled on: https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/#resource-exclusioninclusion |
Issue
We are writing a custom backup plugin where we wish to amend the backup object which is passed in as the second arg.
When attempting to amend the labels or annotations we are not seeing this change reflected in the final backup object.
To amend the passed in *v1.backup we attempted to use the SetAnnotation() method on the backup.ObjectMeta property.
As this failed, we then attempted to set the field directly by accessing the property and setting the value. This change also did not persist.
Expectation
We expected the change to reflect in the final backup object, reachable either by
velero backup describe <backup_name>
orkubectl get backups.velero.io <backup_name>
Replication
An easy way to replicate this issue is by running the following code snippet in a custom plugin:
This instantiates a new backup object when the plugin in called. On the p.log.Info calls you can see this change has reflected, however when the plugin in called on the next item the backup object is the original one, indicating that the change made in the previous call to the plugin has not persisted.
Environment:
--Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-21T01:25:41Z", GoVersion:"go1.13.10", Compiler:"gc", Platform:"linux/amd64"}
--Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.5", GitCommit:"20c265fef0741dd71a66480e35bd69f18351daea", GitTreeState:"clean", BuildDate:"2019-10-15T19:07:57Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
CC @neil-hickey @aclevername
The text was updated successfully, but these errors were encountered: