-
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
Adds support for allowing a RestoreItemAction to skip item restore #1336
Adds support for allowing a RestoreItemAction to skip item restore #1336
Conversation
Signed-off-by: Scott Seago <sseago@redhat.com>
Addresses #1335 |
In our velero fork repo, instead of the full "Autogenerated code to support SkipRestore" commit, I applied a much smaller commit, basically just taking the subset of protoc-generated output that was relevant to my code changes. Instead of a bunch of changes across several files, it only modifies one file, adding SkipRestore to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @sseago! Generally looks reasonable to me. I recall someone else having similar issues when updating proto - one note is that you need to use the protoc plugin protoc-gen-go
v1.0.0 -- which is not the latest version. These instructions may help. Separately, we should probably both containerize and update the go plugin for proto updates.
@carlisia, please take a look as well.
Output of
|
I did a quick proto update with the field you added - you can grab skriss@2293e00 if that's easier |
@skriss Looks like grabbing protoc-gen-go v1.0.0 was all I needed. My proto output now matches the one you linked above. |
This allows a RestoreItemAction plugin to signal to velero that the returned item should be skipped rather than restored to the cluster. To support this, a boolean SkipRestore attribute is added to RestoreItemActionExecuteOutput. If restore.restoreResource finds this set to true, any remaining actions on this item are skipped, and restore on this item is skipped. Execution continues with the next item of this resource type. To signal this for a particular item, the RestoreItemAction's Execute method should call WithoutRestore() on the RestoreItemActionExecuteOutput before returning it. Signed-off-by: Scott Seago <sseago@redhat.com>
Signed-off-by: Scott Seago <sseago@redhat.com>
Signed-off-by: Scott Seago <sseago@redhat.com>
a8a53c2
to
666d5a2
Compare
I've made the suggested changes and fixed the generated code output. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, very useful 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @carlisia, note we should do another update to the plugin-example repo to capture this.
…mware-tanzu#1336) * Adds support for allowing a RestoreItemAction to skip item restore This allows a RestoreItemAction plugin to signal to velero that the returned item should be skipped rather than restored to the cluster. To support this, a boolean SkipRestore attribute is added to RestoreItemActionExecuteOutput. If restore.restoreResource finds this set to true, any remaining actions on this item are skipped, and restore on this item is skipped. Execution continues with the next item of this resource type. To signal this for a particular item, the RestoreItemAction's Execute method should call WithoutRestore() on the RestoreItemActionExecuteOutput before returning it. Signed-off-by: Scott Seago <sseago@redhat.com> * Autogenerated code to support SkipRestore Signed-off-by: Scott Seago <sseago@redhat.com> * Added changelog for vmware-tanzu#1336 Signed-off-by: Scott Seago <sseago@redhat.com>
Scott Seago has made a lot of contributions to Velero, including in testing, coding, and design. Some examples of his contributions include a [design for plugin improvements](https://github.com/vmware-tanzu/velero/blob/main/design/wait-for-additional-items.md), [added skip support to RestoreItemActions](vmware-tanzu#1336), and [reporting important issues](vmware-tanzu#2948). He's also been active in the community meetings for the last few years, and has had thoughtful feedback. Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
Scott Seago has made a lot of contributions to Velero, including in testing, coding, and design. Some examples of his contributions include a [design for plugin improvements](https://github.com/vmware-tanzu/velero/blob/main/design/wait-for-additional-items.md), [added skip support to RestoreItemActions](vmware-tanzu#1336), and [reporting important issues](vmware-tanzu#2948). He's also been active in the community meetings for the last few years, and has had thoughtful feedback. Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
* Propose Scott Seago as a maintainer Scott Seago has made a lot of contributions to Velero, including in testing, coding, and design. Some examples of his contributions include a [design for plugin improvements](https://github.com/vmware-tanzu/velero/blob/main/design/wait-for-additional-items.md), [added skip support to RestoreItemActions](#1336), and [reporting important issues](#2948). He's also been active in the community meetings for the last few years, and has had thoughtful feedback. Signed-off-by: Nolan Brubaker <brubakern@vmware.com> * Fix up file assignments Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
* Propose Scott Seago as a maintainer Scott Seago has made a lot of contributions to Velero, including in testing, coding, and design. Some examples of his contributions include a [design for plugin improvements](https://github.com/vmware-tanzu/velero/blob/main/design/wait-for-additional-items.md), [added skip support to RestoreItemActions](vmware-tanzu#1336), and [reporting important issues](vmware-tanzu#2948). He's also been active in the community meetings for the last few years, and has had thoughtful feedback. Signed-off-by: Nolan Brubaker <brubakern@vmware.com> * Fix up file assignments Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
* Propose Scott Seago as a maintainer Scott Seago has made a lot of contributions to Velero, including in testing, coding, and design. Some examples of his contributions include a [design for plugin improvements](https://github.com/vmware-tanzu/velero/blob/main/design/wait-for-additional-items.md), [added skip support to RestoreItemActions](vmware-tanzu#1336), and [reporting important issues](vmware-tanzu#2948). He's also been active in the community meetings for the last few years, and has had thoughtful feedback. Signed-off-by: Nolan Brubaker <brubakern@vmware.com> * Fix up file assignments Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
Fixes #1335
Adds support for allowing a RestoreItemAction to skip item restore
This allows a RestoreItemAction plugin to signal to velero that
the returned item should be skipped rather than restored to the
cluster.
To support this, a boolean SkipRestore attribute is added to
RestoreItemActionExecuteOutput. If restore.restoreResource finds
this set to true, any remaining actions on this item are skipped,
and restore on this item is skipped. Execution continues with
the next item of this resource type.
To signal this for a particular item, the RestoreItemAction's
Execute method should call WithoutRestore() on the
RestoreItemActionExecuteOutput before returning it.
The autogenerated code may need to be redone. I don't know if I'm using the wrong protoc version or missing a flag of some sort, because it changed a lot more than just around the code changes for this PR.