Adds support for allowing a RestoreItemAction to skip item restore (#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 #1336

Signed-off-by: Scott Seago <sseago@redhat.com>
This commit is contained in:
sseago
2019-04-04 15:39:54 -04:00
committed by Steve Kriss
parent 0167539a14
commit a519547efc
7 changed files with 48 additions and 20 deletions

View File

@@ -117,5 +117,6 @@ func (c *RestoreItemActionGRPCClient) Execute(input *velero.RestoreItemActionExe
return &velero.RestoreItemActionExecuteOutput{
UpdatedItem: &updatedItem,
AdditionalItems: additionalItems,
SkipRestore: res.SkipRestore,
}, nil
}

View File

@@ -126,7 +126,8 @@ func (s *RestoreItemActionGRPCServer) Execute(ctx context.Context, req *proto.Re
}
res := &proto.RestoreItemActionExecuteResponse{
Item: updatedItemJSON,
Item: updatedItemJSON,
SkipRestore: executeOutput.SkipRestore,
}
for _, item := range executeOutput.AdditionalItems {