Refactor BackupItemAction to backupitemaction/v1

Signed-off-by: Hoang, Phuong <phuong.n.hoang@dell.com>
pull/4943/head
Hoang, Phuong 2022-05-27 17:19:36 -04:00 committed by Scott Seago
parent e8494418d4
commit b54424bdc6
27 changed files with 259 additions and 492 deletions

View File

@ -18,6 +18,9 @@ HACK_DIR=$(dirname "${BASH_SOURCE}")
echo "Updating plugin proto"
protoc pkg/plugin/proto/backupitemaction/v1/*.proto --go_out=plugins=grpc:pkg/plugin/generated/ -I pkg/plugin/proto/
protoc pkg/plugin/proto/*.proto --go_out=plugins=grpc:pkg/plugin/generated/ -I pkg/plugin/proto/
cp -rf pkg/plugin/generated/github.com/vmware-tanzu/velero/pkg/plugin/generated/* pkg/plugin/generated
rm -rf pkg/plugin/generated/github.com
echo "Updating plugin proto - done!"

View File

@ -45,6 +45,7 @@ import (
"github.com/vmware-tanzu/velero/pkg/kuberesource"
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
biav1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v1"
"github.com/vmware-tanzu/velero/pkg/podexec"
"github.com/vmware-tanzu/velero/pkg/podvolume"
"github.com/vmware-tanzu/velero/pkg/util/boolptr"
@ -62,7 +63,7 @@ const BackupFormatVersion = "1.1.0"
type Backupper interface {
// Backup takes a backup using the specification in the velerov1api.Backup and writes backup and log data
// to the given writers.
Backup(logger logrus.FieldLogger, backup *Request, backupFile io.Writer, actions []velero.BackupItemAction, volumeSnapshotterGetter VolumeSnapshotterGetter) error
Backup(logger logrus.FieldLogger, backup *Request, backupFile io.Writer, actions []biav1.BackupItemAction, volumeSnapshotterGetter VolumeSnapshotterGetter) error
BackupWithResolvers(log logrus.FieldLogger, backupRequest *Request, backupFile io.Writer,
backupItemActionResolver framework.BackupItemActionResolver, itemSnapshotterResolver framework.ItemSnapshotterResolver,
volumeSnapshotterGetter VolumeSnapshotterGetter) error
@ -170,7 +171,7 @@ type VolumeSnapshotterGetter interface {
// back up individual resources that don't prevent the backup from continuing to be processed) are logged
// to the backup log.
func (kb *kubernetesBackupper) Backup(log logrus.FieldLogger, backupRequest *Request, backupFile io.Writer,
actions []velero.BackupItemAction, volumeSnapshotterGetter VolumeSnapshotterGetter) error {
actions []biav1.BackupItemAction, volumeSnapshotterGetter VolumeSnapshotterGetter) error {
backupItemActions := framework.NewBackupItemActionResolver(actions)
itemSnapshotters := framework.NewItemSnapshotterResolver(nil)
return kb.BackupWithResolvers(log, backupRequest, backupFile, backupItemActions, itemSnapshotters,

View File

@ -47,6 +47,7 @@ import (
"github.com/vmware-tanzu/velero/pkg/discovery"
"github.com/vmware-tanzu/velero/pkg/kuberesource"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
biav1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v1"
"github.com/vmware-tanzu/velero/pkg/podvolume"
"github.com/vmware-tanzu/velero/pkg/test"
testutil "github.com/vmware-tanzu/velero/pkg/test"
@ -1360,7 +1361,7 @@ func TestBackupActionsRunForCorrectItems(t *testing.T) {
h.addItems(t, resource)
}
actions := []velero.BackupItemAction{}
actions := []biav1.BackupItemAction{}
for action := range tc.actions {
actions = append(actions, action)
}
@ -1386,7 +1387,7 @@ func TestBackupWithInvalidActions(t *testing.T) {
name string
backup *velerov1.Backup
apiResources []*test.APIResource
actions []velero.BackupItemAction
actions []biav1.BackupItemAction
}{
{
name: "action with invalid label selector results in an error",
@ -1402,7 +1403,7 @@ func TestBackupWithInvalidActions(t *testing.T) {
builder.ForPersistentVolume("baz").Result(),
),
},
actions: []velero.BackupItemAction{
actions: []biav1.BackupItemAction{
new(recordResourcesAction).ForLabelSelector("=invalid-selector"),
},
},
@ -1420,7 +1421,7 @@ func TestBackupWithInvalidActions(t *testing.T) {
builder.ForPersistentVolume("baz").Result(),
),
},
actions: []velero.BackupItemAction{
actions: []biav1.BackupItemAction{
&appliesToErrorAction{},
},
},
@ -1482,7 +1483,7 @@ func TestBackupActionModifications(t *testing.T) {
name string
backup *velerov1.Backup
apiResources []*test.APIResource
actions []velero.BackupItemAction
actions []biav1.BackupItemAction
want map[string]unstructuredObject
}{
{
@ -1493,7 +1494,7 @@ func TestBackupActionModifications(t *testing.T) {
builder.ForPod("ns-1", "pod-1").Result(),
),
},
actions: []velero.BackupItemAction{
actions: []biav1.BackupItemAction{
modifyingActionGetter(func(item *unstructured.Unstructured) {
item.SetLabels(map[string]string{"updated": "true"})
}),
@ -1510,7 +1511,7 @@ func TestBackupActionModifications(t *testing.T) {
builder.ForPod("ns-1", "pod-1").ObjectMeta(builder.WithLabels("should-be-removed", "true")).Result(),
),
},
actions: []velero.BackupItemAction{
actions: []biav1.BackupItemAction{
modifyingActionGetter(func(item *unstructured.Unstructured) {
item.SetLabels(nil)
}),
@ -1527,7 +1528,7 @@ func TestBackupActionModifications(t *testing.T) {
builder.ForPod("ns-1", "pod-1").Result(),
),
},
actions: []velero.BackupItemAction{
actions: []biav1.BackupItemAction{
modifyingActionGetter(func(item *unstructured.Unstructured) {
item.Object["spec"].(map[string]interface{})["nodeName"] = "foo"
}),
@ -1545,7 +1546,7 @@ func TestBackupActionModifications(t *testing.T) {
builder.ForPod("ns-1", "pod-1").Result(),
),
},
actions: []velero.BackupItemAction{
actions: []biav1.BackupItemAction{
modifyingActionGetter(func(item *unstructured.Unstructured) {
item.SetName(item.GetName() + "-updated")
item.SetNamespace(item.GetNamespace() + "-updated")
@ -1586,7 +1587,7 @@ func TestBackupActionAdditionalItems(t *testing.T) {
name string
backup *velerov1.Backup
apiResources []*test.APIResource
actions []velero.BackupItemAction
actions []biav1.BackupItemAction
want []string
}{
{
@ -1599,7 +1600,7 @@ func TestBackupActionAdditionalItems(t *testing.T) {
builder.ForPod("ns-3", "pod-3").Result(),
),
},
actions: []velero.BackupItemAction{
actions: []biav1.BackupItemAction{
&pluggableAction{
selector: velero.ResourceSelector{IncludedNamespaces: []string{"ns-1"}},
executeFunc: func(item runtime.Unstructured, backup *velerov1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {
@ -1631,7 +1632,7 @@ func TestBackupActionAdditionalItems(t *testing.T) {
builder.ForPod("ns-3", "pod-3").Result(),
),
},
actions: []velero.BackupItemAction{
actions: []biav1.BackupItemAction{
&pluggableAction{
executeFunc: func(item runtime.Unstructured, backup *velerov1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {
additionalItems := []velero.ResourceIdentifier{
@ -1661,7 +1662,7 @@ func TestBackupActionAdditionalItems(t *testing.T) {
builder.ForPersistentVolume("pv-2").Result(),
),
},
actions: []velero.BackupItemAction{
actions: []biav1.BackupItemAction{
&pluggableAction{
executeFunc: func(item runtime.Unstructured, backup *velerov1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {
additionalItems := []velero.ResourceIdentifier{
@ -1694,7 +1695,7 @@ func TestBackupActionAdditionalItems(t *testing.T) {
builder.ForPersistentVolume("pv-2").Result(),
),
},
actions: []velero.BackupItemAction{
actions: []biav1.BackupItemAction{
&pluggableAction{
executeFunc: func(item runtime.Unstructured, backup *velerov1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {
additionalItems := []velero.ResourceIdentifier{
@ -1724,7 +1725,7 @@ func TestBackupActionAdditionalItems(t *testing.T) {
builder.ForPersistentVolume("pv-2").Result(),
),
},
actions: []velero.BackupItemAction{
actions: []biav1.BackupItemAction{
&pluggableAction{
executeFunc: func(item runtime.Unstructured, backup *velerov1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {
additionalItems := []velero.ResourceIdentifier{
@ -1755,7 +1756,7 @@ func TestBackupActionAdditionalItems(t *testing.T) {
builder.ForPersistentVolume("pv-2").Result(),
),
},
actions: []velero.BackupItemAction{
actions: []biav1.BackupItemAction{
&pluggableAction{
executeFunc: func(item runtime.Unstructured, backup *velerov1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {
additionalItems := []velero.ResourceIdentifier{
@ -1785,7 +1786,7 @@ func TestBackupActionAdditionalItems(t *testing.T) {
builder.ForPod("ns-3", "pod-3").Result(),
),
},
actions: []velero.BackupItemAction{
actions: []biav1.BackupItemAction{
&pluggableAction{
selector: velero.ResourceSelector{IncludedNamespaces: []string{"ns-1"}},
executeFunc: func(item runtime.Unstructured, backup *velerov1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error) {

View File

@ -49,7 +49,7 @@ import (
"github.com/vmware-tanzu/velero/pkg/plugin/clientmgmt"
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
pluginmocks "github.com/vmware-tanzu/velero/pkg/plugin/mocks"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
biav1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v1"
velerotest "github.com/vmware-tanzu/velero/pkg/test"
"github.com/vmware-tanzu/velero/pkg/util/boolptr"
"github.com/vmware-tanzu/velero/pkg/util/logging"
@ -59,7 +59,7 @@ type fakeBackupper struct {
mock.Mock
}
func (b *fakeBackupper) Backup(logger logrus.FieldLogger, backup *pkgbackup.Request, backupFile io.Writer, actions []velero.BackupItemAction, volumeSnapshotterGetter pkgbackup.VolumeSnapshotterGetter) error {
func (b *fakeBackupper) Backup(logger logrus.FieldLogger, backup *pkgbackup.Request, backupFile io.Writer, actions []biav1.BackupItemAction, volumeSnapshotterGetter pkgbackup.VolumeSnapshotterGetter) error {
args := b.Called(logger, backup, backupFile, actions, volumeSnapshotterGetter)
return args.Error(0)
}
@ -843,7 +843,7 @@ func TestProcessBackupCompletions(t *testing.T) {
pluginManager.On("GetBackupItemActions").Return(nil, nil)
pluginManager.On("CleanupClients").Return(nil)
pluginManager.On("GetItemSnapshotters").Return(nil, nil)
backupper.On("Backup", mock.Anything, mock.Anything, mock.Anything, []velero.BackupItemAction(nil), pluginManager).Return(nil)
backupper.On("Backup", mock.Anything, mock.Anything, mock.Anything, []biav1.BackupItemAction(nil), pluginManager).Return(nil)
backupper.On("BackupWithResolvers", mock.Anything, mock.Anything, mock.Anything, framework.BackupItemActionResolver{}, framework.ItemSnapshotterResolver{}, pluginManager).Return(nil)
backupStore.On("BackupExists", test.backupLocation.Spec.StorageType.ObjectStorage.Bucket, test.backup.Name).Return(test.backupExists, test.existenceCheckError)

View File

@ -20,12 +20,12 @@ import (
"strings"
"sync"
v1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1"
"github.com/sirupsen/logrus"
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
biav1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v1"
isv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1"
)
// Manager manages the lifecycles of plugins.
@ -37,10 +37,10 @@ type Manager interface {
GetVolumeSnapshotter(name string) (velero.VolumeSnapshotter, error)
// GetBackupItemActions returns all backup item action plugins.
GetBackupItemActions() ([]velero.BackupItemAction, error)
GetBackupItemActions() ([]biav1.BackupItemAction, error)
// GetBackupItemAction returns the backup item action plugin for name.
GetBackupItemAction(name string) (velero.BackupItemAction, error)
GetBackupItemAction(name string) (biav1.BackupItemAction, error)
// GetRestoreItemActions returns all restore item action plugins.
GetRestoreItemActions() ([]velero.RestoreItemAction, error)
@ -55,10 +55,10 @@ type Manager interface {
GetDeleteItemAction(name string) (velero.DeleteItemAction, error)
// GetItemSnapshotter returns the item snapshotter plugin for name
GetItemSnapshotter(name string) (v1.ItemSnapshotter, error)
GetItemSnapshotter(name string) (isv1.ItemSnapshotter, error)
// GetItemSnapshotters returns all item snapshotter plugins
GetItemSnapshotters() ([]v1.ItemSnapshotter, error)
GetItemSnapshotters() ([]isv1.ItemSnapshotter, error)
// CleanupClients terminates all of the Manager's running plugin processes.
CleanupClients()
@ -166,10 +166,10 @@ func (m *manager) GetVolumeSnapshotter(name string) (velero.VolumeSnapshotter, e
}
// GetBackupItemActions returns all backup item actions as restartableBackupItemActions.
func (m *manager) GetBackupItemActions() ([]velero.BackupItemAction, error) {
func (m *manager) GetBackupItemActions() ([]biav1.BackupItemAction, error) {
list := m.registry.List(framework.PluginKindBackupItemAction)
actions := make([]velero.BackupItemAction, 0, len(list))
actions := make([]biav1.BackupItemAction, 0, len(list))
for i := range list {
id := list[i]
@ -186,7 +186,7 @@ func (m *manager) GetBackupItemActions() ([]velero.BackupItemAction, error) {
}
// GetBackupItemAction returns a restartableBackupItemAction for name.
func (m *manager) GetBackupItemAction(name string) (velero.BackupItemAction, error) {
func (m *manager) GetBackupItemAction(name string) (biav1.BackupItemAction, error) {
name = sanitizeName(name)
restartableProcess, err := m.getRestartableProcess(framework.PluginKindBackupItemAction, name)
@ -264,7 +264,7 @@ func (m *manager) GetDeleteItemAction(name string) (velero.DeleteItemAction, err
return r, nil
}
func (m *manager) GetItemSnapshotter(name string) (v1.ItemSnapshotter, error) {
func (m *manager) GetItemSnapshotter(name string) (isv1.ItemSnapshotter, error) {
name = sanitizeName(name)
restartableProcess, err := m.getRestartableProcess(framework.PluginKindItemSnapshotter, name)
@ -276,10 +276,10 @@ func (m *manager) GetItemSnapshotter(name string) (v1.ItemSnapshotter, error) {
return r, nil
}
func (m *manager) GetItemSnapshotters() ([]v1.ItemSnapshotter, error) {
func (m *manager) GetItemSnapshotters() ([]isv1.ItemSnapshotter, error) {
list := m.registry.List(framework.PluginKindItemSnapshotter)
actions := make([]v1.ItemSnapshotter, 0, len(list))
actions := make([]isv1.ItemSnapshotter, 0, len(list))
for i := range list {
id := list[i]

View File

@ -23,6 +23,7 @@ import (
api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
biav1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v1"
)
// restartableBackupItemAction is a backup item action for a given implementation (such as "pod"). It is associated with
@ -45,13 +46,13 @@ func newRestartableBackupItemAction(name string, sharedPluginProcess Restartable
// getBackupItemAction returns the backup item action for this restartableBackupItemAction. It does *not* restart the
// plugin process.
func (r *restartableBackupItemAction) getBackupItemAction() (velero.BackupItemAction, error) {
func (r *restartableBackupItemAction) getBackupItemAction() (biav1.BackupItemAction, error) {
plugin, err := r.sharedPluginProcess.getByKindAndName(r.key)
if err != nil {
return nil, err
}
backupItemAction, ok := plugin.(velero.BackupItemAction)
backupItemAction, ok := plugin.(biav1.BackupItemAction)
if !ok {
return nil, errors.Errorf("%T is not a BackupItemAction!", plugin)
}
@ -60,7 +61,7 @@ func (r *restartableBackupItemAction) getBackupItemAction() (velero.BackupItemAc
}
// getDelegate restarts the plugin process (if needed) and returns the backup item action for this restartableBackupItemAction.
func (r *restartableBackupItemAction) getDelegate() (velero.BackupItemAction, error) {
func (r *restartableBackupItemAction) getDelegate() (biav1.BackupItemAction, error) {
if err := r.sharedPluginProcess.resetIfNeeded(); err != nil {
return nil, err
}

View File

@ -22,10 +22,10 @@ import (
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime/schema"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
isv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1"
"github.com/vmware-tanzu/velero/pkg/discovery"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
biav1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v1"
isv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1"
"github.com/vmware-tanzu/velero/pkg/util/collections"
)
@ -98,11 +98,11 @@ func resolveAction(helper discovery.Helper, action velero.Applicable) (resources
}
type BackupItemResolvedAction struct {
velero.BackupItemAction
biav1.BackupItemAction
resolvedAction
}
func NewBackupItemActionResolver(actions []velero.BackupItemAction) BackupItemActionResolver {
func NewBackupItemActionResolver(actions []biav1.BackupItemAction) BackupItemActionResolver {
return BackupItemActionResolver{
actions: actions,
}
@ -131,7 +131,7 @@ type ActionResolver interface {
}
type BackupItemActionResolver struct {
actions []velero.BackupItemAction
actions []biav1.BackupItemAction
}
func (recv BackupItemActionResolver) ResolveActions(helper discovery.Helper) ([]BackupItemResolvedAction, error) {

View File

@ -21,7 +21,7 @@ import (
"golang.org/x/net/context"
"google.golang.org/grpc"
proto "github.com/vmware-tanzu/velero/pkg/plugin/generated"
protobiav1 "github.com/vmware-tanzu/velero/pkg/plugin/generated/backupitemaction/v1"
)
// BackupItemActionPlugin is an implementation of go-plugin's Plugin
@ -39,6 +39,6 @@ func (p *BackupItemActionPlugin) GRPCClient(_ context.Context, _ *plugin.GRPCBro
// GRPCServer registers a BackupItemAction gRPC server.
func (p *BackupItemActionPlugin) GRPCServer(_ *plugin.GRPCBroker, server *grpc.Server) error {
proto.RegisterBackupItemActionServer(server, &BackupItemActionGRPCServer{mux: p.serverMux})
protobiav1.RegisterBackupItemActionServer(server, &BackupItemActionGRPCServer{mux: p.serverMux})
return nil
}

View File

@ -27,7 +27,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
proto "github.com/vmware-tanzu/velero/pkg/plugin/generated"
protobiav1 "github.com/vmware-tanzu/velero/pkg/plugin/generated/backupitemaction/v1"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
)
@ -42,18 +42,18 @@ func NewBackupItemActionPlugin(options ...PluginOption) *BackupItemActionPlugin
// gRPC client to make calls to the plugin server.
type BackupItemActionGRPCClient struct {
*clientBase
grpcClient proto.BackupItemActionClient
grpcClient protobiav1.BackupItemActionClient
}
func newBackupItemActionGRPCClient(base *clientBase, clientConn *grpc.ClientConn) interface{} {
return &BackupItemActionGRPCClient{
clientBase: base,
grpcClient: proto.NewBackupItemActionClient(clientConn),
grpcClient: protobiav1.NewBackupItemActionClient(clientConn),
}
}
func (c *BackupItemActionGRPCClient) AppliesTo() (velero.ResourceSelector, error) {
req := &proto.BackupItemActionAppliesToRequest{
req := &protobiav1.BackupItemActionAppliesToRequest{
Plugin: c.plugin,
}
@ -86,7 +86,7 @@ func (c *BackupItemActionGRPCClient) Execute(item runtime.Unstructured, backup *
return nil, nil, errors.WithStack(err)
}
req := &proto.ExecuteRequest{
req := &protobiav1.ExecuteRequest{
Plugin: c.plugin,
Item: itemJSON,
Backup: backupJSON,

View File

@ -25,7 +25,9 @@ import (
api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
proto "github.com/vmware-tanzu/velero/pkg/plugin/generated"
protobiav1 "github.com/vmware-tanzu/velero/pkg/plugin/generated/backupitemaction/v1"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
biav1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v1"
)
// BackupItemActionGRPCServer implements the proto-generated BackupItemAction interface, and accepts
@ -34,13 +36,13 @@ type BackupItemActionGRPCServer struct {
mux *serverMux
}
func (s *BackupItemActionGRPCServer) getImpl(name string) (velero.BackupItemAction, error) {
func (s *BackupItemActionGRPCServer) getImpl(name string) (biav1.BackupItemAction, error) {
impl, err := s.mux.getHandler(name)
if err != nil {
return nil, err
}
itemAction, ok := impl.(velero.BackupItemAction)
itemAction, ok := impl.(biav1.BackupItemAction)
if !ok {
return nil, errors.Errorf("%T is not a backup item action", impl)
}
@ -48,7 +50,9 @@ func (s *BackupItemActionGRPCServer) getImpl(name string) (velero.BackupItemActi
return itemAction, nil
}
func (s *BackupItemActionGRPCServer) AppliesTo(ctx context.Context, req *proto.BackupItemActionAppliesToRequest) (response *proto.BackupItemActionAppliesToResponse, err error) {
func (s *BackupItemActionGRPCServer) AppliesTo(
ctx context.Context, req *protobiav1.BackupItemActionAppliesToRequest) (
response *protobiav1.BackupItemActionAppliesToResponse, err error) {
defer func() {
if recoveredErr := handlePanic(recover()); recoveredErr != nil {
err = recoveredErr
@ -65,7 +69,7 @@ func (s *BackupItemActionGRPCServer) AppliesTo(ctx context.Context, req *proto.B
return nil, newGRPCError(err)
}
return &proto.BackupItemActionAppliesToResponse{
return &protobiav1.BackupItemActionAppliesToResponse{
&proto.ResourceSelector{
IncludedNamespaces: resourceSelector.IncludedNamespaces,
ExcludedNamespaces: resourceSelector.ExcludedNamespaces,
@ -76,7 +80,8 @@ func (s *BackupItemActionGRPCServer) AppliesTo(ctx context.Context, req *proto.B
}, nil
}
func (s *BackupItemActionGRPCServer) Execute(ctx context.Context, req *proto.ExecuteRequest) (response *proto.ExecuteResponse, err error) {
func (s *BackupItemActionGRPCServer) Execute(
ctx context.Context, req *protobiav1.ExecuteRequest) (response *protobiav1.ExecuteResponse, err error) {
defer func() {
if recoveredErr := handlePanic(recover()); recoveredErr != nil {
err = recoveredErr
@ -115,7 +120,7 @@ func (s *BackupItemActionGRPCServer) Execute(ctx context.Context, req *proto.Exe
}
}
res := &proto.ExecuteResponse{
res := &protobiav1.ExecuteResponse{
Item: updatedItemJSON,
}

View File

@ -31,6 +31,7 @@ import (
v1 "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
"github.com/vmware-tanzu/velero/pkg/backup/mocks"
proto "github.com/vmware-tanzu/velero/pkg/plugin/generated"
protobiav1 "github.com/vmware-tanzu/velero/pkg/plugin/generated/backupitemaction/v1"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
velerotest "github.com/vmware-tanzu/velero/pkg/test"
)
@ -160,7 +161,7 @@ func TestBackupItemActionGRPCServerExecute(t *testing.T) {
},
}}
req := &proto.ExecuteRequest{
req := &protobiav1.ExecuteRequest{
Plugin: "xyz",
Item: test.item,
Backup: test.backup,

View File

@ -21,14 +21,13 @@ import (
"encoding/json"
"time"
isv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1"
"github.com/pkg/errors"
"google.golang.org/grpc"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
proto "github.com/vmware-tanzu/velero/pkg/plugin/generated"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
isv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1"
)
// NewItemSnapshotterPlugin constructs a ItemSnapshotterPlugin.

View File

@ -1,323 +0,0 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: BackupItemAction.proto
/*
Package generated is a generated protocol buffer package.
It is generated from these files:
BackupItemAction.proto
DeleteItemAction.proto
ItemSnapshotter.proto
ObjectStore.proto
PluginLister.proto
RestoreItemAction.proto
Shared.proto
VolumeSnapshotter.proto
It has these top-level messages:
ExecuteRequest
ExecuteResponse
BackupItemActionAppliesToRequest
BackupItemActionAppliesToResponse
DeleteItemActionExecuteRequest
DeleteItemActionAppliesToRequest
DeleteItemActionAppliesToResponse
ItemSnapshotterAppliesToRequest
ItemSnapshotterAppliesToResponse
AlsoHandlesRequest
AlsoHandlesResponse
SnapshotItemRequest
SnapshotItemResponse
ProgressRequest
ProgressResponse
DeleteItemSnapshotRequest
CreateItemFromSnapshotRequest
CreateItemFromSnapshotResponse
ItemSnapshotterInitRequest
PutObjectRequest
ObjectExistsRequest
ObjectExistsResponse
GetObjectRequest
Bytes
ListCommonPrefixesRequest
ListCommonPrefixesResponse
ListObjectsRequest
ListObjectsResponse
DeleteObjectRequest
CreateSignedURLRequest
CreateSignedURLResponse
ObjectStoreInitRequest
PluginIdentifier
ListPluginsResponse
RestoreItemActionExecuteRequest
RestoreItemActionExecuteResponse
RestoreItemActionAppliesToRequest
RestoreItemActionAppliesToResponse
Empty
Stack
StackFrame
ResourceIdentifier
ResourceSelector
CreateVolumeRequest
CreateVolumeResponse
GetVolumeInfoRequest
GetVolumeInfoResponse
CreateSnapshotRequest
CreateSnapshotResponse
DeleteSnapshotRequest
GetVolumeIDRequest
GetVolumeIDResponse
SetVolumeIDRequest
SetVolumeIDResponse
VolumeSnapshotterInitRequest
*/
package generated
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type ExecuteRequest struct {
Plugin string `protobuf:"bytes,1,opt,name=plugin" json:"plugin,omitempty"`
Item []byte `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"`
Backup []byte `protobuf:"bytes,3,opt,name=backup,proto3" json:"backup,omitempty"`
}
func (m *ExecuteRequest) Reset() { *m = ExecuteRequest{} }
func (m *ExecuteRequest) String() string { return proto.CompactTextString(m) }
func (*ExecuteRequest) ProtoMessage() {}
func (*ExecuteRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *ExecuteRequest) GetPlugin() string {
if m != nil {
return m.Plugin
}
return ""
}
func (m *ExecuteRequest) GetItem() []byte {
if m != nil {
return m.Item
}
return nil
}
func (m *ExecuteRequest) GetBackup() []byte {
if m != nil {
return m.Backup
}
return nil
}
type ExecuteResponse struct {
Item []byte `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"`
AdditionalItems []*ResourceIdentifier `protobuf:"bytes,2,rep,name=additionalItems" json:"additionalItems,omitempty"`
}
func (m *ExecuteResponse) Reset() { *m = ExecuteResponse{} }
func (m *ExecuteResponse) String() string { return proto.CompactTextString(m) }
func (*ExecuteResponse) ProtoMessage() {}
func (*ExecuteResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
func (m *ExecuteResponse) GetItem() []byte {
if m != nil {
return m.Item
}
return nil
}
func (m *ExecuteResponse) GetAdditionalItems() []*ResourceIdentifier {
if m != nil {
return m.AdditionalItems
}
return nil
}
type BackupItemActionAppliesToRequest struct {
Plugin string `protobuf:"bytes,1,opt,name=plugin" json:"plugin,omitempty"`
}
func (m *BackupItemActionAppliesToRequest) Reset() { *m = BackupItemActionAppliesToRequest{} }
func (m *BackupItemActionAppliesToRequest) String() string { return proto.CompactTextString(m) }
func (*BackupItemActionAppliesToRequest) ProtoMessage() {}
func (*BackupItemActionAppliesToRequest) Descriptor() ([]byte, []int) {
return fileDescriptor0, []int{2}
}
func (m *BackupItemActionAppliesToRequest) GetPlugin() string {
if m != nil {
return m.Plugin
}
return ""
}
type BackupItemActionAppliesToResponse struct {
ResourceSelector *ResourceSelector `protobuf:"bytes,1,opt,name=ResourceSelector" json:"ResourceSelector,omitempty"`
}
func (m *BackupItemActionAppliesToResponse) Reset() { *m = BackupItemActionAppliesToResponse{} }
func (m *BackupItemActionAppliesToResponse) String() string { return proto.CompactTextString(m) }
func (*BackupItemActionAppliesToResponse) ProtoMessage() {}
func (*BackupItemActionAppliesToResponse) Descriptor() ([]byte, []int) {
return fileDescriptor0, []int{3}
}
func (m *BackupItemActionAppliesToResponse) GetResourceSelector() *ResourceSelector {
if m != nil {
return m.ResourceSelector
}
return nil
}
func init() {
proto.RegisterType((*ExecuteRequest)(nil), "generated.ExecuteRequest")
proto.RegisterType((*ExecuteResponse)(nil), "generated.ExecuteResponse")
proto.RegisterType((*BackupItemActionAppliesToRequest)(nil), "generated.BackupItemActionAppliesToRequest")
proto.RegisterType((*BackupItemActionAppliesToResponse)(nil), "generated.BackupItemActionAppliesToResponse")
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for BackupItemAction service
type BackupItemActionClient interface {
AppliesTo(ctx context.Context, in *BackupItemActionAppliesToRequest, opts ...grpc.CallOption) (*BackupItemActionAppliesToResponse, error)
Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*ExecuteResponse, error)
}
type backupItemActionClient struct {
cc *grpc.ClientConn
}
func NewBackupItemActionClient(cc *grpc.ClientConn) BackupItemActionClient {
return &backupItemActionClient{cc}
}
func (c *backupItemActionClient) AppliesTo(ctx context.Context, in *BackupItemActionAppliesToRequest, opts ...grpc.CallOption) (*BackupItemActionAppliesToResponse, error) {
out := new(BackupItemActionAppliesToResponse)
err := grpc.Invoke(ctx, "/generated.BackupItemAction/AppliesTo", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *backupItemActionClient) Execute(ctx context.Context, in *ExecuteRequest, opts ...grpc.CallOption) (*ExecuteResponse, error) {
out := new(ExecuteResponse)
err := grpc.Invoke(ctx, "/generated.BackupItemAction/Execute", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for BackupItemAction service
type BackupItemActionServer interface {
AppliesTo(context.Context, *BackupItemActionAppliesToRequest) (*BackupItemActionAppliesToResponse, error)
Execute(context.Context, *ExecuteRequest) (*ExecuteResponse, error)
}
func RegisterBackupItemActionServer(s *grpc.Server, srv BackupItemActionServer) {
s.RegisterService(&_BackupItemAction_serviceDesc, srv)
}
func _BackupItemAction_AppliesTo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BackupItemActionAppliesToRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackupItemActionServer).AppliesTo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/generated.BackupItemAction/AppliesTo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackupItemActionServer).AppliesTo(ctx, req.(*BackupItemActionAppliesToRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BackupItemAction_Execute_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ExecuteRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BackupItemActionServer).Execute(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/generated.BackupItemAction/Execute",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BackupItemActionServer).Execute(ctx, req.(*ExecuteRequest))
}
return interceptor(ctx, in, info, handler)
}
var _BackupItemAction_serviceDesc = grpc.ServiceDesc{
ServiceName: "generated.BackupItemAction",
HandlerType: (*BackupItemActionServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "AppliesTo",
Handler: _BackupItemAction_AppliesTo_Handler,
},
{
MethodName: "Execute",
Handler: _BackupItemAction_Execute_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "BackupItemAction.proto",
}
func init() { proto.RegisterFile("BackupItemAction.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 293 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x4a, 0xc3, 0x40,
0x10, 0x86, 0x49, 0x2b, 0x95, 0x4e, 0x8b, 0x2d, 0x7b, 0x28, 0x31, 0x22, 0xc4, 0x9c, 0x02, 0x4a,
0x0e, 0xf1, 0xe6, 0xc9, 0x0a, 0x52, 0x7a, 0xdd, 0xf6, 0x05, 0xd2, 0x64, 0x5a, 0x17, 0xd3, 0xdd,
0x75, 0x77, 0x03, 0x3e, 0x9c, 0x0f, 0x27, 0xd9, 0x6e, 0x43, 0x8c, 0xc5, 0x7a, 0xcb, 0x64, 0xe6,
0xff, 0xe7, 0xfb, 0xd9, 0x81, 0xd9, 0x4b, 0x96, 0xbf, 0x57, 0x72, 0x69, 0x70, 0x3f, 0xcf, 0x0d,
0x13, 0x3c, 0x91, 0x4a, 0x18, 0x41, 0x86, 0x3b, 0xe4, 0xa8, 0x32, 0x83, 0x45, 0x30, 0x5e, 0xbd,
0x65, 0x0a, 0x8b, 0x43, 0x23, 0x5a, 0xc3, 0xd5, 0xeb, 0x27, 0xe6, 0x95, 0x41, 0x8a, 0x1f, 0x15,
0x6a, 0x43, 0x66, 0x30, 0x90, 0x65, 0xb5, 0x63, 0xdc, 0xf7, 0x42, 0x2f, 0x1e, 0x52, 0x57, 0x11,
0x02, 0x17, 0xcc, 0xe0, 0xde, 0xef, 0x85, 0x5e, 0x3c, 0xa6, 0xf6, 0xbb, 0x9e, 0xdd, 0xd8, 0x85,
0x7e, 0xdf, 0xfe, 0x75, 0x55, 0xc4, 0x61, 0xd2, 0xb8, 0x6a, 0x29, 0xb8, 0xc6, 0x46, 0xee, 0xb5,
0xe4, 0x0b, 0x98, 0x64, 0x45, 0xc1, 0x6a, 0xce, 0xac, 0xac, 0x99, 0xb5, 0xdf, 0x0b, 0xfb, 0xf1,
0x28, 0xbd, 0x4d, 0x1a, 0xde, 0x84, 0xa2, 0x16, 0x95, 0xca, 0x71, 0x59, 0x20, 0x37, 0x6c, 0xcb,
0x50, 0xd1, 0xae, 0x2a, 0x7a, 0x82, 0xb0, 0x1b, 0x7c, 0x2e, 0x65, 0xc9, 0x50, 0xaf, 0xc5, 0x99,
0x5c, 0x51, 0x09, 0x77, 0x7f, 0x68, 0x1d, 0xfd, 0x02, 0xa6, 0x47, 0x8e, 0x15, 0x96, 0x98, 0x1b,
0xa1, 0xac, 0xcd, 0x28, 0xbd, 0x39, 0x81, 0x7a, 0x1c, 0xa1, 0xbf, 0x44, 0xe9, 0x97, 0x07, 0xd3,
0xee, 0x3a, 0xb2, 0x85, 0x61, 0xb3, 0x92, 0xdc, 0xb7, 0x0c, 0xcf, 0x85, 0x0a, 0x1e, 0xfe, 0x37,
0xec, 0x52, 0x3c, 0xc3, 0xa5, 0x7b, 0x16, 0x72, 0xdd, 0x12, 0xfe, 0x3c, 0x80, 0x20, 0x38, 0xd5,
0x3a, 0x38, 0x6c, 0x06, 0xf6, 0x6a, 0x1e, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x45, 0xdb, 0x5d,
0x9f, 0x68, 0x02, 0x00, 0x00,
}

View File

@ -1,6 +1,71 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: DeleteItemAction.proto
/*
Package generated is a generated protocol buffer package.
It is generated from these files:
DeleteItemAction.proto
ItemSnapshotter.proto
ObjectStore.proto
PluginLister.proto
RestoreItemAction.proto
Shared.proto
VolumeSnapshotter.proto
It has these top-level messages:
DeleteItemActionExecuteRequest
DeleteItemActionAppliesToRequest
DeleteItemActionAppliesToResponse
ItemSnapshotterAppliesToRequest
ItemSnapshotterAppliesToResponse
AlsoHandlesRequest
AlsoHandlesResponse
SnapshotItemRequest
SnapshotItemResponse
ProgressRequest
ProgressResponse
DeleteItemSnapshotRequest
CreateItemFromSnapshotRequest
CreateItemFromSnapshotResponse
ItemSnapshotterInitRequest
PutObjectRequest
ObjectExistsRequest
ObjectExistsResponse
GetObjectRequest
Bytes
ListCommonPrefixesRequest
ListCommonPrefixesResponse
ListObjectsRequest
ListObjectsResponse
DeleteObjectRequest
CreateSignedURLRequest
CreateSignedURLResponse
ObjectStoreInitRequest
PluginIdentifier
ListPluginsResponse
RestoreItemActionExecuteRequest
RestoreItemActionExecuteResponse
RestoreItemActionAppliesToRequest
RestoreItemActionAppliesToResponse
Empty
Stack
StackFrame
ResourceIdentifier
ResourceSelector
CreateVolumeRequest
CreateVolumeResponse
GetVolumeInfoRequest
GetVolumeInfoResponse
CreateSnapshotRequest
CreateSnapshotResponse
DeleteSnapshotRequest
GetVolumeIDRequest
GetVolumeIDResponse
SetVolumeIDRequest
SetVolumeIDResponse
VolumeSnapshotterInitRequest
*/
package generated
import proto "github.com/golang/protobuf/proto"
@ -17,6 +82,12 @@ var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type DeleteItemActionExecuteRequest struct {
Plugin string `protobuf:"bytes,1,opt,name=plugin" json:"plugin,omitempty"`
Item []byte `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"`
@ -26,7 +97,7 @@ type DeleteItemActionExecuteRequest struct {
func (m *DeleteItemActionExecuteRequest) Reset() { *m = DeleteItemActionExecuteRequest{} }
func (m *DeleteItemActionExecuteRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteItemActionExecuteRequest) ProtoMessage() {}
func (*DeleteItemActionExecuteRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
func (*DeleteItemActionExecuteRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func (m *DeleteItemActionExecuteRequest) GetPlugin() string {
if m != nil {
@ -57,7 +128,7 @@ func (m *DeleteItemActionAppliesToRequest) Reset() { *m = DeleteItemActi
func (m *DeleteItemActionAppliesToRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteItemActionAppliesToRequest) ProtoMessage() {}
func (*DeleteItemActionAppliesToRequest) Descriptor() ([]byte, []int) {
return fileDescriptor1, []int{1}
return fileDescriptor0, []int{1}
}
func (m *DeleteItemActionAppliesToRequest) GetPlugin() string {
@ -75,7 +146,7 @@ func (m *DeleteItemActionAppliesToResponse) Reset() { *m = DeleteItemAct
func (m *DeleteItemActionAppliesToResponse) String() string { return proto.CompactTextString(m) }
func (*DeleteItemActionAppliesToResponse) ProtoMessage() {}
func (*DeleteItemActionAppliesToResponse) Descriptor() ([]byte, []int) {
return fileDescriptor1, []int{2}
return fileDescriptor0, []int{2}
}
func (m *DeleteItemActionAppliesToResponse) GetResourceSelector() *ResourceSelector {
@ -196,9 +267,9 @@ var _DeleteItemAction_serviceDesc = grpc.ServiceDesc{
Metadata: "DeleteItemAction.proto",
}
func init() { proto.RegisterFile("DeleteItemAction.proto", fileDescriptor1) }
func init() { proto.RegisterFile("DeleteItemAction.proto", fileDescriptor0) }
var fileDescriptor1 = []byte{
var fileDescriptor0 = []byte{
// 253 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x41, 0x4b, 0xc3, 0x40,
0x14, 0x84, 0x89, 0x4a, 0x25, 0xcf, 0x1e, 0xc2, 0x1e, 0x4a, 0x88, 0x20, 0x31, 0xa7, 0x8a, 0x92,

View File

@ -25,7 +25,7 @@ func (m *ItemSnapshotterAppliesToRequest) Reset() { *m = ItemSnapshotter
func (m *ItemSnapshotterAppliesToRequest) String() string { return proto.CompactTextString(m) }
func (*ItemSnapshotterAppliesToRequest) ProtoMessage() {}
func (*ItemSnapshotterAppliesToRequest) Descriptor() ([]byte, []int) {
return fileDescriptor2, []int{0}
return fileDescriptor1, []int{0}
}
func (m *ItemSnapshotterAppliesToRequest) GetPlugin() string {
@ -43,7 +43,7 @@ func (m *ItemSnapshotterAppliesToResponse) Reset() { *m = ItemSnapshotte
func (m *ItemSnapshotterAppliesToResponse) String() string { return proto.CompactTextString(m) }
func (*ItemSnapshotterAppliesToResponse) ProtoMessage() {}
func (*ItemSnapshotterAppliesToResponse) Descriptor() ([]byte, []int) {
return fileDescriptor2, []int{1}
return fileDescriptor1, []int{1}
}
func (m *ItemSnapshotterAppliesToResponse) GetResourceSelector() *ResourceSelector {
@ -62,7 +62,7 @@ type AlsoHandlesRequest struct {
func (m *AlsoHandlesRequest) Reset() { *m = AlsoHandlesRequest{} }
func (m *AlsoHandlesRequest) String() string { return proto.CompactTextString(m) }
func (*AlsoHandlesRequest) ProtoMessage() {}
func (*AlsoHandlesRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} }
func (*AlsoHandlesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} }
func (m *AlsoHandlesRequest) GetPlugin() string {
if m != nil {
@ -92,7 +92,7 @@ type AlsoHandlesResponse struct {
func (m *AlsoHandlesResponse) Reset() { *m = AlsoHandlesResponse{} }
func (m *AlsoHandlesResponse) String() string { return proto.CompactTextString(m) }
func (*AlsoHandlesResponse) ProtoMessage() {}
func (*AlsoHandlesResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} }
func (*AlsoHandlesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} }
func (m *AlsoHandlesResponse) GetHandledItems() []*ResourceIdentifier {
if m != nil {
@ -111,7 +111,7 @@ type SnapshotItemRequest struct {
func (m *SnapshotItemRequest) Reset() { *m = SnapshotItemRequest{} }
func (m *SnapshotItemRequest) String() string { return proto.CompactTextString(m) }
func (*SnapshotItemRequest) ProtoMessage() {}
func (*SnapshotItemRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} }
func (*SnapshotItemRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} }
func (m *SnapshotItemRequest) GetPlugin() string {
if m != nil {
@ -152,7 +152,7 @@ type SnapshotItemResponse struct {
func (m *SnapshotItemResponse) Reset() { *m = SnapshotItemResponse{} }
func (m *SnapshotItemResponse) String() string { return proto.CompactTextString(m) }
func (*SnapshotItemResponse) ProtoMessage() {}
func (*SnapshotItemResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} }
func (*SnapshotItemResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} }
func (m *SnapshotItemResponse) GetItem() []byte {
if m != nil {
@ -199,7 +199,7 @@ type ProgressRequest struct {
func (m *ProgressRequest) Reset() { *m = ProgressRequest{} }
func (m *ProgressRequest) String() string { return proto.CompactTextString(m) }
func (*ProgressRequest) ProtoMessage() {}
func (*ProgressRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} }
func (*ProgressRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} }
func (m *ProgressRequest) GetPlugin() string {
if m != nil {
@ -243,7 +243,7 @@ type ProgressResponse struct {
func (m *ProgressResponse) Reset() { *m = ProgressResponse{} }
func (m *ProgressResponse) String() string { return proto.CompactTextString(m) }
func (*ProgressResponse) ProtoMessage() {}
func (*ProgressResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{7} }
func (*ProgressResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} }
func (m *ProgressResponse) GetPhase() string {
if m != nil {
@ -312,7 +312,7 @@ type DeleteItemSnapshotRequest struct {
func (m *DeleteItemSnapshotRequest) Reset() { *m = DeleteItemSnapshotRequest{} }
func (m *DeleteItemSnapshotRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteItemSnapshotRequest) ProtoMessage() {}
func (*DeleteItemSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{8} }
func (*DeleteItemSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} }
func (m *DeleteItemSnapshotRequest) GetPlugin() string {
if m != nil {
@ -362,7 +362,7 @@ type CreateItemFromSnapshotRequest struct {
func (m *CreateItemFromSnapshotRequest) Reset() { *m = CreateItemFromSnapshotRequest{} }
func (m *CreateItemFromSnapshotRequest) String() string { return proto.CompactTextString(m) }
func (*CreateItemFromSnapshotRequest) ProtoMessage() {}
func (*CreateItemFromSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{9} }
func (*CreateItemFromSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} }
func (m *CreateItemFromSnapshotRequest) GetPlugin() string {
if m != nil {
@ -423,7 +423,7 @@ func (m *CreateItemFromSnapshotResponse) Reset() { *m = CreateItemFromSn
func (m *CreateItemFromSnapshotResponse) String() string { return proto.CompactTextString(m) }
func (*CreateItemFromSnapshotResponse) ProtoMessage() {}
func (*CreateItemFromSnapshotResponse) Descriptor() ([]byte, []int) {
return fileDescriptor2, []int{10}
return fileDescriptor1, []int{10}
}
func (m *CreateItemFromSnapshotResponse) GetItem() []byte {
@ -455,7 +455,7 @@ type ItemSnapshotterInitRequest struct {
func (m *ItemSnapshotterInitRequest) Reset() { *m = ItemSnapshotterInitRequest{} }
func (m *ItemSnapshotterInitRequest) String() string { return proto.CompactTextString(m) }
func (*ItemSnapshotterInitRequest) ProtoMessage() {}
func (*ItemSnapshotterInitRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{11} }
func (*ItemSnapshotterInitRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{11} }
func (m *ItemSnapshotterInitRequest) GetPlugin() string {
if m != nil {
@ -756,9 +756,9 @@ var _ItemSnapshotter_serviceDesc = grpc.ServiceDesc{
Metadata: "ItemSnapshotter.proto",
}
func init() { proto.RegisterFile("ItemSnapshotter.proto", fileDescriptor2) }
func init() { proto.RegisterFile("ItemSnapshotter.proto", fileDescriptor1) }
var fileDescriptor2 = []byte{
var fileDescriptor1 = []byte{
// 887 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x5f, 0x8f, 0xdb, 0x44,
0x10, 0x97, 0xe3, 0x5c, 0xee, 0x6e, 0x12, 0x7a, 0xd1, 0xf6, 0x5a, 0x19, 0x57, 0xbd, 0x46, 0x16,

View File

@ -27,7 +27,7 @@ type PutObjectRequest struct {
func (m *PutObjectRequest) Reset() { *m = PutObjectRequest{} }
func (m *PutObjectRequest) String() string { return proto.CompactTextString(m) }
func (*PutObjectRequest) ProtoMessage() {}
func (*PutObjectRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} }
func (*PutObjectRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} }
func (m *PutObjectRequest) GetPlugin() string {
if m != nil {
@ -66,7 +66,7 @@ type ObjectExistsRequest struct {
func (m *ObjectExistsRequest) Reset() { *m = ObjectExistsRequest{} }
func (m *ObjectExistsRequest) String() string { return proto.CompactTextString(m) }
func (*ObjectExistsRequest) ProtoMessage() {}
func (*ObjectExistsRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} }
func (*ObjectExistsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} }
func (m *ObjectExistsRequest) GetPlugin() string {
if m != nil {
@ -96,7 +96,7 @@ type ObjectExistsResponse struct {
func (m *ObjectExistsResponse) Reset() { *m = ObjectExistsResponse{} }
func (m *ObjectExistsResponse) String() string { return proto.CompactTextString(m) }
func (*ObjectExistsResponse) ProtoMessage() {}
func (*ObjectExistsResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{2} }
func (*ObjectExistsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} }
func (m *ObjectExistsResponse) GetExists() bool {
if m != nil {
@ -114,7 +114,7 @@ type GetObjectRequest struct {
func (m *GetObjectRequest) Reset() { *m = GetObjectRequest{} }
func (m *GetObjectRequest) String() string { return proto.CompactTextString(m) }
func (*GetObjectRequest) ProtoMessage() {}
func (*GetObjectRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{3} }
func (*GetObjectRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} }
func (m *GetObjectRequest) GetPlugin() string {
if m != nil {
@ -144,7 +144,7 @@ type Bytes struct {
func (m *Bytes) Reset() { *m = Bytes{} }
func (m *Bytes) String() string { return proto.CompactTextString(m) }
func (*Bytes) ProtoMessage() {}
func (*Bytes) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{4} }
func (*Bytes) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} }
func (m *Bytes) GetData() []byte {
if m != nil {
@ -163,7 +163,7 @@ type ListCommonPrefixesRequest struct {
func (m *ListCommonPrefixesRequest) Reset() { *m = ListCommonPrefixesRequest{} }
func (m *ListCommonPrefixesRequest) String() string { return proto.CompactTextString(m) }
func (*ListCommonPrefixesRequest) ProtoMessage() {}
func (*ListCommonPrefixesRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{5} }
func (*ListCommonPrefixesRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} }
func (m *ListCommonPrefixesRequest) GetPlugin() string {
if m != nil {
@ -200,7 +200,7 @@ type ListCommonPrefixesResponse struct {
func (m *ListCommonPrefixesResponse) Reset() { *m = ListCommonPrefixesResponse{} }
func (m *ListCommonPrefixesResponse) String() string { return proto.CompactTextString(m) }
func (*ListCommonPrefixesResponse) ProtoMessage() {}
func (*ListCommonPrefixesResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{6} }
func (*ListCommonPrefixesResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} }
func (m *ListCommonPrefixesResponse) GetPrefixes() []string {
if m != nil {
@ -218,7 +218,7 @@ type ListObjectsRequest struct {
func (m *ListObjectsRequest) Reset() { *m = ListObjectsRequest{} }
func (m *ListObjectsRequest) String() string { return proto.CompactTextString(m) }
func (*ListObjectsRequest) ProtoMessage() {}
func (*ListObjectsRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{7} }
func (*ListObjectsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{7} }
func (m *ListObjectsRequest) GetPlugin() string {
if m != nil {
@ -248,7 +248,7 @@ type ListObjectsResponse struct {
func (m *ListObjectsResponse) Reset() { *m = ListObjectsResponse{} }
func (m *ListObjectsResponse) String() string { return proto.CompactTextString(m) }
func (*ListObjectsResponse) ProtoMessage() {}
func (*ListObjectsResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{8} }
func (*ListObjectsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{8} }
func (m *ListObjectsResponse) GetKeys() []string {
if m != nil {
@ -266,7 +266,7 @@ type DeleteObjectRequest struct {
func (m *DeleteObjectRequest) Reset() { *m = DeleteObjectRequest{} }
func (m *DeleteObjectRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteObjectRequest) ProtoMessage() {}
func (*DeleteObjectRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{9} }
func (*DeleteObjectRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{9} }
func (m *DeleteObjectRequest) GetPlugin() string {
if m != nil {
@ -299,7 +299,7 @@ type CreateSignedURLRequest struct {
func (m *CreateSignedURLRequest) Reset() { *m = CreateSignedURLRequest{} }
func (m *CreateSignedURLRequest) String() string { return proto.CompactTextString(m) }
func (*CreateSignedURLRequest) ProtoMessage() {}
func (*CreateSignedURLRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{10} }
func (*CreateSignedURLRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{10} }
func (m *CreateSignedURLRequest) GetPlugin() string {
if m != nil {
@ -336,7 +336,7 @@ type CreateSignedURLResponse struct {
func (m *CreateSignedURLResponse) Reset() { *m = CreateSignedURLResponse{} }
func (m *CreateSignedURLResponse) String() string { return proto.CompactTextString(m) }
func (*CreateSignedURLResponse) ProtoMessage() {}
func (*CreateSignedURLResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{11} }
func (*CreateSignedURLResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{11} }
func (m *CreateSignedURLResponse) GetUrl() string {
if m != nil {
@ -353,7 +353,7 @@ type ObjectStoreInitRequest struct {
func (m *ObjectStoreInitRequest) Reset() { *m = ObjectStoreInitRequest{} }
func (m *ObjectStoreInitRequest) String() string { return proto.CompactTextString(m) }
func (*ObjectStoreInitRequest) ProtoMessage() {}
func (*ObjectStoreInitRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{12} }
func (*ObjectStoreInitRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{12} }
func (m *ObjectStoreInitRequest) GetPlugin() string {
if m != nil {
@ -750,9 +750,9 @@ var _ObjectStore_serviceDesc = grpc.ServiceDesc{
Metadata: "ObjectStore.proto",
}
func init() { proto.RegisterFile("ObjectStore.proto", fileDescriptor3) }
func init() { proto.RegisterFile("ObjectStore.proto", fileDescriptor2) }
var fileDescriptor3 = []byte{
var fileDescriptor2 = []byte{
// 577 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcd, 0x6e, 0xd3, 0x40,
0x10, 0xd6, 0xc6, 0x69, 0x54, 0x4f, 0x22, 0x61, 0xb6, 0x55, 0x30, 0x2e, 0x94, 0xb0, 0x02, 0x29,

View File

@ -26,7 +26,7 @@ type PluginIdentifier struct {
func (m *PluginIdentifier) Reset() { *m = PluginIdentifier{} }
func (m *PluginIdentifier) String() string { return proto.CompactTextString(m) }
func (*PluginIdentifier) ProtoMessage() {}
func (*PluginIdentifier) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} }
func (*PluginIdentifier) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} }
func (m *PluginIdentifier) GetCommand() string {
if m != nil {
@ -56,7 +56,7 @@ type ListPluginsResponse struct {
func (m *ListPluginsResponse) Reset() { *m = ListPluginsResponse{} }
func (m *ListPluginsResponse) String() string { return proto.CompactTextString(m) }
func (*ListPluginsResponse) ProtoMessage() {}
func (*ListPluginsResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} }
func (*ListPluginsResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} }
func (m *ListPluginsResponse) GetPlugins() []*PluginIdentifier {
if m != nil {
@ -142,9 +142,9 @@ var _PluginLister_serviceDesc = grpc.ServiceDesc{
Metadata: "PluginLister.proto",
}
func init() { proto.RegisterFile("PluginLister.proto", fileDescriptor4) }
func init() { proto.RegisterFile("PluginLister.proto", fileDescriptor3) }
var fileDescriptor4 = []byte{
var fileDescriptor3 = []byte{
// 201 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x0a, 0xc8, 0x29, 0x4d,
0xcf, 0xcc, 0xf3, 0xc9, 0x2c, 0x2e, 0x49, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2,

View File

@ -28,7 +28,7 @@ func (m *RestoreItemActionExecuteRequest) Reset() { *m = RestoreItemActi
func (m *RestoreItemActionExecuteRequest) String() string { return proto.CompactTextString(m) }
func (*RestoreItemActionExecuteRequest) ProtoMessage() {}
func (*RestoreItemActionExecuteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor5, []int{0}
return fileDescriptor4, []int{0}
}
func (m *RestoreItemActionExecuteRequest) GetPlugin() string {
@ -69,7 +69,7 @@ func (m *RestoreItemActionExecuteResponse) Reset() { *m = RestoreItemAct
func (m *RestoreItemActionExecuteResponse) String() string { return proto.CompactTextString(m) }
func (*RestoreItemActionExecuteResponse) ProtoMessage() {}
func (*RestoreItemActionExecuteResponse) Descriptor() ([]byte, []int) {
return fileDescriptor5, []int{1}
return fileDescriptor4, []int{1}
}
func (m *RestoreItemActionExecuteResponse) GetItem() []byte {
@ -101,7 +101,7 @@ func (m *RestoreItemActionAppliesToRequest) Reset() { *m = RestoreItemAc
func (m *RestoreItemActionAppliesToRequest) String() string { return proto.CompactTextString(m) }
func (*RestoreItemActionAppliesToRequest) ProtoMessage() {}
func (*RestoreItemActionAppliesToRequest) Descriptor() ([]byte, []int) {
return fileDescriptor5, []int{2}
return fileDescriptor4, []int{2}
}
func (m *RestoreItemActionAppliesToRequest) GetPlugin() string {
@ -119,7 +119,7 @@ func (m *RestoreItemActionAppliesToResponse) Reset() { *m = RestoreItemA
func (m *RestoreItemActionAppliesToResponse) String() string { return proto.CompactTextString(m) }
func (*RestoreItemActionAppliesToResponse) ProtoMessage() {}
func (*RestoreItemActionAppliesToResponse) Descriptor() ([]byte, []int) {
return fileDescriptor5, []int{3}
return fileDescriptor4, []int{3}
}
func (m *RestoreItemActionAppliesToResponse) GetResourceSelector() *ResourceSelector {
@ -241,9 +241,9 @@ var _RestoreItemAction_serviceDesc = grpc.ServiceDesc{
Metadata: "RestoreItemAction.proto",
}
func init() { proto.RegisterFile("RestoreItemAction.proto", fileDescriptor5) }
func init() { proto.RegisterFile("RestoreItemAction.proto", fileDescriptor4) }
var fileDescriptor5 = []byte{
var fileDescriptor4 = []byte{
// 332 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xdd, 0x4e, 0xc2, 0x30,
0x14, 0x4e, 0x81, 0x80, 0x1c, 0x88, 0x3f, 0xbd, 0xd0, 0x06, 0x63, 0x9c, 0xbb, 0x30, 0xc4, 0x1f,

View File

@ -18,7 +18,7 @@ type Empty struct {
func (m *Empty) Reset() { *m = Empty{} }
func (m *Empty) String() string { return proto.CompactTextString(m) }
func (*Empty) ProtoMessage() {}
func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{0} }
func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} }
type Stack struct {
Frames []*StackFrame `protobuf:"bytes,1,rep,name=frames" json:"frames,omitempty"`
@ -27,7 +27,7 @@ type Stack struct {
func (m *Stack) Reset() { *m = Stack{} }
func (m *Stack) String() string { return proto.CompactTextString(m) }
func (*Stack) ProtoMessage() {}
func (*Stack) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{1} }
func (*Stack) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{1} }
func (m *Stack) GetFrames() []*StackFrame {
if m != nil {
@ -45,7 +45,7 @@ type StackFrame struct {
func (m *StackFrame) Reset() { *m = StackFrame{} }
func (m *StackFrame) String() string { return proto.CompactTextString(m) }
func (*StackFrame) ProtoMessage() {}
func (*StackFrame) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{2} }
func (*StackFrame) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{2} }
func (m *StackFrame) GetFile() string {
if m != nil {
@ -78,7 +78,7 @@ type ResourceIdentifier struct {
func (m *ResourceIdentifier) Reset() { *m = ResourceIdentifier{} }
func (m *ResourceIdentifier) String() string { return proto.CompactTextString(m) }
func (*ResourceIdentifier) ProtoMessage() {}
func (*ResourceIdentifier) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{3} }
func (*ResourceIdentifier) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{3} }
func (m *ResourceIdentifier) GetGroup() string {
if m != nil {
@ -119,7 +119,7 @@ type ResourceSelector struct {
func (m *ResourceSelector) Reset() { *m = ResourceSelector{} }
func (m *ResourceSelector) String() string { return proto.CompactTextString(m) }
func (*ResourceSelector) ProtoMessage() {}
func (*ResourceSelector) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{4} }
func (*ResourceSelector) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{4} }
func (m *ResourceSelector) GetIncludedNamespaces() []string {
if m != nil {
@ -164,27 +164,30 @@ func init() {
proto.RegisterType((*ResourceSelector)(nil), "generated.ResourceSelector")
}
func init() { proto.RegisterFile("Shared.proto", fileDescriptor6) }
func init() { proto.RegisterFile("Shared.proto", fileDescriptor5) }
var fileDescriptor6 = []byte{
// 294 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xc1, 0x4e, 0xb5, 0x30,
0x10, 0x85, 0xc3, 0x05, 0xee, 0xff, 0x33, 0xba, 0xd0, 0x46, 0x93, 0xc6, 0xb8, 0x20, 0xac, 0x58,
0x28, 0x0b, 0x4d, 0x7c, 0x03, 0x4d, 0xdc, 0x18, 0x53, 0x9e, 0x00, 0xcb, 0x70, 0x6d, 0xe4, 0xb6,
0xa4, 0x94, 0xe4, 0xfa, 0xca, 0x3e, 0x85, 0x69, 0x4b, 0x61, 0x81, 0xbb, 0x39, 0x73, 0x3e, 0xce,
0x0c, 0x93, 0xc2, 0x79, 0xfd, 0xd9, 0x68, 0x6c, 0xab, 0x41, 0x2b, 0xa3, 0x48, 0x76, 0x40, 0x89,
0xba, 0x31, 0xd8, 0x16, 0xff, 0x20, 0x7d, 0x3e, 0x0e, 0xe6, 0xbb, 0x78, 0x82, 0xb4, 0x36, 0x0d,
0xff, 0x22, 0xf7, 0xb0, 0xef, 0x74, 0x73, 0xc4, 0x91, 0x46, 0x79, 0x5c, 0x9e, 0x3d, 0x5c, 0x57,
0x0b, 0x5d, 0x39, 0xe2, 0xc5, 0xba, 0x6c, 0x86, 0x8a, 0x77, 0x80, 0xb5, 0x4b, 0x08, 0x24, 0x9d,
0xe8, 0x91, 0x46, 0x79, 0x54, 0x66, 0xcc, 0xd5, 0xb6, 0xd7, 0x0b, 0x89, 0x74, 0x97, 0x47, 0x65,
0xca, 0x5c, 0x4d, 0x6e, 0xe0, 0x7f, 0x37, 0x49, 0x6e, 0x84, 0x92, 0x34, 0x76, 0xec, 0xa2, 0x8b,
0x13, 0x10, 0x86, 0xa3, 0x9a, 0x34, 0xc7, 0xd7, 0x16, 0xa5, 0x11, 0x9d, 0x40, 0x4d, 0xae, 0x20,
0x3d, 0x68, 0x35, 0x0d, 0x73, 0xb4, 0x17, 0x36, 0x47, 0xcf, 0xac, 0xcb, 0xcf, 0xd8, 0xa2, 0xc9,
0x2d, 0x64, 0xd2, 0xae, 0x38, 0x34, 0x1c, 0xe7, 0x21, 0x6b, 0xc3, 0x6e, 0x65, 0x05, 0x4d, 0xfc,
0xa6, 0xb6, 0x2e, 0x7e, 0x22, 0xb8, 0x08, 0xa3, 0x6b, 0xec, 0x91, 0x1b, 0xa5, 0x49, 0x05, 0x44,
0x48, 0xde, 0x4f, 0x2d, 0xb6, 0x6f, 0xe1, 0x6b, 0x7f, 0x9b, 0x8c, 0xfd, 0xe1, 0x58, 0x1e, 0x4f,
0x1b, 0x7e, 0xe7, 0xf9, 0xad, 0x43, 0xee, 0xe0, 0x32, 0xa4, 0x84, 0xd9, 0x23, 0x8d, 0x1d, 0xbe,
0x35, 0x2c, 0x1d, 0x32, 0x56, 0x3a, 0xf1, 0xf4, 0xc6, 0xb0, 0xe7, 0x19, 0xe7, 0xff, 0xa0, 0xa9,
0x3f, 0x4f, 0xd0, 0x1f, 0x7b, 0xf7, 0x16, 0x1e, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x83,
0xa1, 0x97, 0x1b, 0x02, 0x00, 0x00,
var fileDescriptor5 = []byte{
// 337 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x92, 0xcd, 0x4e, 0xeb, 0x30,
0x10, 0x85, 0x95, 0xb6, 0xe9, 0xbd, 0x19, 0x58, 0x80, 0x05, 0x52, 0x84, 0x58, 0x54, 0x59, 0x75,
0x41, 0x13, 0x89, 0x0a, 0x1e, 0x00, 0x09, 0x24, 0x36, 0x08, 0xa5, 0x3b, 0x76, 0xae, 0x33, 0x49,
0xad, 0x26, 0x76, 0xe4, 0xd8, 0xa5, 0xf0, 0xc8, 0x3c, 0x05, 0xb2, 0xf3, 0xd3, 0x45, 0xd8, 0xcd,
0x99, 0xf3, 0xe5, 0xcc, 0x64, 0x64, 0x38, 0xdf, 0xec, 0xa8, 0xc2, 0x2c, 0xae, 0x95, 0xd4, 0x92,
0x04, 0x05, 0x0a, 0x54, 0x54, 0x63, 0x16, 0xfd, 0x03, 0xff, 0xb9, 0xaa, 0xf5, 0x57, 0xf4, 0x08,
0xfe, 0x46, 0x53, 0xb6, 0x27, 0x2b, 0x98, 0xe7, 0x8a, 0x56, 0xd8, 0x84, 0xde, 0x62, 0xba, 0x3c,
0xbb, 0xbf, 0x8e, 0x07, 0x3a, 0x76, 0xc4, 0x8b, 0x75, 0xd3, 0x0e, 0x8a, 0xde, 0x01, 0x4e, 0x5d,
0x42, 0x60, 0x96, 0xf3, 0x12, 0x43, 0x6f, 0xe1, 0x2d, 0x83, 0xd4, 0xd5, 0xb6, 0x57, 0x72, 0x81,
0xe1, 0x64, 0xe1, 0x2d, 0xfd, 0xd4, 0xd5, 0xe4, 0x06, 0xfe, 0xe7, 0x46, 0x30, 0xcd, 0xa5, 0x08,
0xa7, 0x8e, 0x1d, 0x74, 0x74, 0x04, 0x92, 0x62, 0x23, 0x8d, 0x62, 0xf8, 0x9a, 0xa1, 0xd0, 0x3c,
0xe7, 0xa8, 0xc8, 0x15, 0xf8, 0x85, 0x92, 0xa6, 0xee, 0xa2, 0x5b, 0x61, 0x73, 0x54, 0xc7, 0xba,
0xfc, 0x20, 0x1d, 0x34, 0xb9, 0x85, 0x40, 0xd8, 0x15, 0x6b, 0xca, 0xb0, 0x1b, 0x72, 0x6a, 0xd8,
0xad, 0xac, 0x08, 0x67, 0xed, 0xa6, 0xb6, 0x8e, 0x7e, 0x3c, 0xb8, 0xe8, 0x47, 0x6f, 0xb0, 0x44,
0xa6, 0xa5, 0x22, 0x31, 0x10, 0x2e, 0x58, 0x69, 0x32, 0xcc, 0xde, 0xfa, 0xaf, 0xdb, 0xdb, 0x04,
0xe9, 0x1f, 0x8e, 0xe5, 0xf1, 0x38, 0xe2, 0x27, 0x2d, 0x3f, 0x76, 0xc8, 0x1d, 0x5c, 0xf6, 0x29,
0xfd, 0xec, 0x26, 0x9c, 0x3a, 0x7c, 0x6c, 0x58, 0xba, 0xcf, 0x38, 0xd1, 0xb3, 0x96, 0x1e, 0x19,
0xf6, 0x3c, 0x4d, 0xf7, 0x1f, 0xa1, 0xdf, 0x9e, 0xa7, 0xd7, 0x4f, 0x0f, 0x1f, 0xeb, 0x82, 0xeb,
0x9d, 0xd9, 0xc6, 0x4c, 0x56, 0xc9, 0xa1, 0xfa, 0xa4, 0x0a, 0x57, 0x9a, 0x8a, 0x6f, 0x93, 0x1c,
0xb0, 0x44, 0x25, 0x93, 0x7a, 0x5f, 0x24, 0x75, 0x69, 0x0a, 0x2e, 0x92, 0xe1, 0x09, 0x6c, 0xe7,
0xee, 0x09, 0xad, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x58, 0x4c, 0x5c, 0x87, 0x52, 0x02, 0x00,
0x00,
}

View File

@ -28,7 +28,7 @@ type CreateVolumeRequest struct {
func (m *CreateVolumeRequest) Reset() { *m = CreateVolumeRequest{} }
func (m *CreateVolumeRequest) String() string { return proto.CompactTextString(m) }
func (*CreateVolumeRequest) ProtoMessage() {}
func (*CreateVolumeRequest) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{0} }
func (*CreateVolumeRequest) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{0} }
func (m *CreateVolumeRequest) GetPlugin() string {
if m != nil {
@ -72,7 +72,7 @@ type CreateVolumeResponse struct {
func (m *CreateVolumeResponse) Reset() { *m = CreateVolumeResponse{} }
func (m *CreateVolumeResponse) String() string { return proto.CompactTextString(m) }
func (*CreateVolumeResponse) ProtoMessage() {}
func (*CreateVolumeResponse) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{1} }
func (*CreateVolumeResponse) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{1} }
func (m *CreateVolumeResponse) GetVolumeID() string {
if m != nil {
@ -90,7 +90,7 @@ type GetVolumeInfoRequest struct {
func (m *GetVolumeInfoRequest) Reset() { *m = GetVolumeInfoRequest{} }
func (m *GetVolumeInfoRequest) String() string { return proto.CompactTextString(m) }
func (*GetVolumeInfoRequest) ProtoMessage() {}
func (*GetVolumeInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{2} }
func (*GetVolumeInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{2} }
func (m *GetVolumeInfoRequest) GetPlugin() string {
if m != nil {
@ -121,7 +121,7 @@ type GetVolumeInfoResponse struct {
func (m *GetVolumeInfoResponse) Reset() { *m = GetVolumeInfoResponse{} }
func (m *GetVolumeInfoResponse) String() string { return proto.CompactTextString(m) }
func (*GetVolumeInfoResponse) ProtoMessage() {}
func (*GetVolumeInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{3} }
func (*GetVolumeInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{3} }
func (m *GetVolumeInfoResponse) GetVolumeType() string {
if m != nil {
@ -147,7 +147,7 @@ type CreateSnapshotRequest struct {
func (m *CreateSnapshotRequest) Reset() { *m = CreateSnapshotRequest{} }
func (m *CreateSnapshotRequest) String() string { return proto.CompactTextString(m) }
func (*CreateSnapshotRequest) ProtoMessage() {}
func (*CreateSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{4} }
func (*CreateSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{4} }
func (m *CreateSnapshotRequest) GetPlugin() string {
if m != nil {
@ -184,7 +184,7 @@ type CreateSnapshotResponse struct {
func (m *CreateSnapshotResponse) Reset() { *m = CreateSnapshotResponse{} }
func (m *CreateSnapshotResponse) String() string { return proto.CompactTextString(m) }
func (*CreateSnapshotResponse) ProtoMessage() {}
func (*CreateSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{5} }
func (*CreateSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{5} }
func (m *CreateSnapshotResponse) GetSnapshotID() string {
if m != nil {
@ -201,7 +201,7 @@ type DeleteSnapshotRequest struct {
func (m *DeleteSnapshotRequest) Reset() { *m = DeleteSnapshotRequest{} }
func (m *DeleteSnapshotRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteSnapshotRequest) ProtoMessage() {}
func (*DeleteSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{6} }
func (*DeleteSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{6} }
func (m *DeleteSnapshotRequest) GetPlugin() string {
if m != nil {
@ -225,7 +225,7 @@ type GetVolumeIDRequest struct {
func (m *GetVolumeIDRequest) Reset() { *m = GetVolumeIDRequest{} }
func (m *GetVolumeIDRequest) String() string { return proto.CompactTextString(m) }
func (*GetVolumeIDRequest) ProtoMessage() {}
func (*GetVolumeIDRequest) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{7} }
func (*GetVolumeIDRequest) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{7} }
func (m *GetVolumeIDRequest) GetPlugin() string {
if m != nil {
@ -248,7 +248,7 @@ type GetVolumeIDResponse struct {
func (m *GetVolumeIDResponse) Reset() { *m = GetVolumeIDResponse{} }
func (m *GetVolumeIDResponse) String() string { return proto.CompactTextString(m) }
func (*GetVolumeIDResponse) ProtoMessage() {}
func (*GetVolumeIDResponse) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{8} }
func (*GetVolumeIDResponse) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{8} }
func (m *GetVolumeIDResponse) GetVolumeID() string {
if m != nil {
@ -266,7 +266,7 @@ type SetVolumeIDRequest struct {
func (m *SetVolumeIDRequest) Reset() { *m = SetVolumeIDRequest{} }
func (m *SetVolumeIDRequest) String() string { return proto.CompactTextString(m) }
func (*SetVolumeIDRequest) ProtoMessage() {}
func (*SetVolumeIDRequest) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{9} }
func (*SetVolumeIDRequest) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{9} }
func (m *SetVolumeIDRequest) GetPlugin() string {
if m != nil {
@ -296,7 +296,7 @@ type SetVolumeIDResponse struct {
func (m *SetVolumeIDResponse) Reset() { *m = SetVolumeIDResponse{} }
func (m *SetVolumeIDResponse) String() string { return proto.CompactTextString(m) }
func (*SetVolumeIDResponse) ProtoMessage() {}
func (*SetVolumeIDResponse) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{10} }
func (*SetVolumeIDResponse) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{10} }
func (m *SetVolumeIDResponse) GetPersistentVolume() []byte {
if m != nil {
@ -313,7 +313,7 @@ type VolumeSnapshotterInitRequest struct {
func (m *VolumeSnapshotterInitRequest) Reset() { *m = VolumeSnapshotterInitRequest{} }
func (m *VolumeSnapshotterInitRequest) String() string { return proto.CompactTextString(m) }
func (*VolumeSnapshotterInitRequest) ProtoMessage() {}
func (*VolumeSnapshotterInitRequest) Descriptor() ([]byte, []int) { return fileDescriptor7, []int{11} }
func (*VolumeSnapshotterInitRequest) Descriptor() ([]byte, []int) { return fileDescriptor6, []int{11} }
func (m *VolumeSnapshotterInitRequest) GetPlugin() string {
if m != nil {
@ -614,9 +614,9 @@ var _VolumeSnapshotter_serviceDesc = grpc.ServiceDesc{
Metadata: "VolumeSnapshotter.proto",
}
func init() { proto.RegisterFile("VolumeSnapshotter.proto", fileDescriptor7) }
func init() { proto.RegisterFile("VolumeSnapshotter.proto", fileDescriptor6) }
var fileDescriptor7 = []byte{
var fileDescriptor6 = []byte{
// 566 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xc1, 0x6e, 0xd3, 0x40,
0x10, 0xd5, 0xda, 0x6e, 0x44, 0x26, 0xa5, 0x0a, 0x9b, 0xa4, 0x58, 0x16, 0x04, 0xe3, 0x0b, 0x51,

View File

@ -4,7 +4,9 @@ package mocks
import (
mock "github.com/stretchr/testify/mock"
velero "github.com/vmware-tanzu/velero/pkg/plugin/velero"
biav1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v1"
isv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1"
)
@ -19,15 +21,15 @@ func (_m *Manager) CleanupClients() {
}
// GetBackupItemAction provides a mock function with given fields: name
func (_m *Manager) GetBackupItemAction(name string) (velero.BackupItemAction, error) {
func (_m *Manager) GetBackupItemAction(name string) (biav1.BackupItemAction, error) {
ret := _m.Called(name)
var r0 velero.BackupItemAction
if rf, ok := ret.Get(0).(func(string) velero.BackupItemAction); ok {
var r0 biav1.BackupItemAction
if rf, ok := ret.Get(0).(func(string) biav1.BackupItemAction); ok {
r0 = rf(name)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(velero.BackupItemAction)
r0 = ret.Get(0).(biav1.BackupItemAction)
}
}
@ -42,15 +44,15 @@ func (_m *Manager) GetBackupItemAction(name string) (velero.BackupItemAction, er
}
// GetBackupItemActions provides a mock function with given fields:
func (_m *Manager) GetBackupItemActions() ([]velero.BackupItemAction, error) {
func (_m *Manager) GetBackupItemActions() ([]biav1.BackupItemAction, error) {
ret := _m.Called()
var r0 []velero.BackupItemAction
if rf, ok := ret.Get(0).(func() []velero.BackupItemAction); ok {
var r0 []biav1.BackupItemAction
if rf, ok := ret.Get(0).(func() []biav1.BackupItemAction); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).([]velero.BackupItemAction)
r0 = ret.Get(0).([]biav1.BackupItemAction)
}
}

View File

@ -1,5 +1,6 @@
syntax = "proto3";
package generated;
option go_package = "github.com/vmware-tanzu/velero/pkg/plugin/generated";
message Empty {}

View File

@ -1,5 +1,6 @@
syntax = "proto3";
package generated;
package v1;
option go_package = "github.com/vmware-tanzu/velero/pkg/plugin/generated/backupitemaction/v1";
import "Shared.proto";
@ -11,7 +12,7 @@ message ExecuteRequest {
message ExecuteResponse {
bytes item = 1;
repeated ResourceIdentifier additionalItems = 2;
repeated generated.ResourceIdentifier additionalItems = 2;
}
service BackupItemAction {
@ -24,5 +25,5 @@ message BackupItemActionAppliesToRequest {
}
message BackupItemActionAppliesToResponse {
ResourceSelector ResourceSelector = 1;
generated.ResourceSelector ResourceSelector = 1;
}

View File

@ -14,13 +14,13 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package velero
package v1
import (
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
)
// BackupItemAction is an actor that performs an operation on an individual item being backed up.
@ -28,18 +28,11 @@ type BackupItemAction interface {
// AppliesTo returns information about which resources this action should be invoked for.
// A BackupItemAction's Execute function will only be invoked on items that match the returned
// selector. A zero-valued ResourceSelector matches all resources.
AppliesTo() (ResourceSelector, error)
AppliesTo() (velero.ResourceSelector, error)
// Execute allows the ItemAction to perform arbitrary logic with the item being backed up,
// including mutating the item itself prior to backup. The item (unmodified or modified)
// should be returned, along with an optional slice of ResourceIdentifiers specifying
// additional related items that should be backed up.
Execute(item runtime.Unstructured, backup *api.Backup) (runtime.Unstructured, []ResourceIdentifier, error)
}
// ResourceIdentifier describes a single item by its group, resource, namespace, and name.
type ResourceIdentifier struct {
schema.GroupResource
Namespace string
Name string
Execute(item runtime.Unstructured, backup *api.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error)
}

View File

@ -21,11 +21,10 @@ import (
"fmt"
"time"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
"k8s.io/apimachinery/pkg/runtime"
api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
)
type AlsoHandlesInput struct {

View File

@ -5,9 +5,9 @@ package mocks
import (
context "context"
mock "github.com/stretchr/testify/mock"
v1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1"
velero "github.com/vmware-tanzu/velero/pkg/plugin/velero"
v1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1"
)
// ItemSnapshotter is an autogenerated mock type for the ItemSnapshotter type

View File

@ -20,6 +20,8 @@ limitations under the License.
// plugins of any type can be implemented.
package velero
import "k8s.io/apimachinery/pkg/runtime/schema"
// ResourceSelector is a collection of included/excluded namespaces,
// included/excluded resources, and a label-selector that can be used
// to match a set of items from a cluster.
@ -54,3 +56,10 @@ type Applicable interface {
// AppliesTo returns information about which resources this Responder should be invoked for.
AppliesTo() (ResourceSelector, error)
}
// ResourceIdentifier describes a single item by its group, resource, namespace, and name.
type ResourceIdentifier struct {
schema.GroupResource
Namespace string
Name string
}