diff --git a/pkg/backup/backup.go b/pkg/backup/backup.go index 2a9ba51c29..1fcbdc13e5 100644 --- a/pkg/backup/backup.go +++ b/pkg/backup/backup.go @@ -67,9 +67,7 @@ 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 []biav2.BackupItemAction, volumeSnapshotterGetter VolumeSnapshotterGetter) error - BackupWithResolvers(log logrus.FieldLogger, backupRequest *Request, backupFile io.Writer, - backupItemActionResolver framework.BackupItemActionResolverV2, itemSnapshotterResolver framework.ItemSnapshotterResolver, - volumeSnapshotterGetter VolumeSnapshotterGetter) error + BackupWithResolvers(log logrus.FieldLogger, backupRequest *Request, backupFile io.Writer, backupItemActionResolver framework.BackupItemActionResolverV2, volumeSnapshotterGetter VolumeSnapshotterGetter) error FinalizeBackup(log logrus.FieldLogger, backupRequest *Request, inBackupFile io.Reader, outBackupFile io.Writer, backupItemActionResolver framework.BackupItemActionResolverV2, asyncBIAOperations []*itemoperation.BackupOperation) error @@ -182,16 +180,13 @@ type VolumeSnapshotterGetter interface { func (kb *kubernetesBackupper) Backup(log logrus.FieldLogger, backupRequest *Request, backupFile io.Writer, actions []biav2.BackupItemAction, volumeSnapshotterGetter VolumeSnapshotterGetter) error { backupItemActions := framework.NewBackupItemActionResolverV2(actions) - itemSnapshotters := framework.NewItemSnapshotterResolver(nil) - return kb.BackupWithResolvers(log, backupRequest, backupFile, backupItemActions, itemSnapshotters, - volumeSnapshotterGetter) + return kb.BackupWithResolvers(log, backupRequest, backupFile, backupItemActions, volumeSnapshotterGetter) } func (kb *kubernetesBackupper) BackupWithResolvers(log logrus.FieldLogger, backupRequest *Request, backupFile io.Writer, backupItemActionResolver framework.BackupItemActionResolverV2, - itemSnapshotterResolver framework.ItemSnapshotterResolver, volumeSnapshotterGetter VolumeSnapshotterGetter) error { gzippedData := gzip.NewWriter(backupFile) defer gzippedData.Close() @@ -239,12 +234,6 @@ func (kb *kubernetesBackupper) BackupWithResolvers(log logrus.FieldLogger, return err } - backupRequest.ResolvedItemSnapshotters, err = itemSnapshotterResolver.ResolveActions(kb.discoveryHelper, log) - if err != nil { - log.WithError(errors.WithStack(err)).Debugf("Error from itemSnapshotterResolver.ResolveActions") - return err - } - backupRequest.BackedUpItems = map[itemKey]struct{}{} podVolumeTimeout := kb.podVolumeTimeout diff --git a/pkg/backup/request.go b/pkg/backup/request.go index bf1e5dd914..8b4f739e81 100644 --- a/pkg/backup/request.go +++ b/pkg/backup/request.go @@ -47,7 +47,6 @@ type Request struct { ResourceIncludesExcludes collections.IncludesExcludesInterface ResourceHooks []hook.ResourceHook ResolvedActions []framework.BackupItemResolvedActionV2 - ResolvedItemSnapshotters []framework.ItemSnapshotterResolvedAction VolumeSnapshots []*volume.Snapshot PodVolumeBackups []*velerov1api.PodVolumeBackup BackedUpItems map[itemKey]struct{} diff --git a/pkg/controller/backup_controller.go b/pkg/controller/backup_controller.go index 89c457c3d3..4c7822b41a 100644 --- a/pkg/controller/backup_controller.go +++ b/pkg/controller/backup_controller.go @@ -611,11 +611,6 @@ func (b *backupReconciler) runBackup(backup *pkgbackup.Request) error { if err != nil { return err } - itemSnapshotters, err := pluginManager.GetItemSnapshotters() - if err != nil { - return err - } - backupLog.Info("Setting up backup store to check for backup existence") backupStore, err := b.backupStoreGetter.Get(backup.StorageLocation, pluginManager, backupLog) if err != nil { @@ -633,11 +628,9 @@ func (b *backupReconciler) runBackup(backup *pkgbackup.Request) error { } backupItemActionsResolver := framework.NewBackupItemActionResolverV2(actions) - itemSnapshottersResolver := framework.NewItemSnapshotterResolver(itemSnapshotters) var fatalErrs []error - if err := b.backupper.BackupWithResolvers(backupLog, backup, backupFile, backupItemActionsResolver, - itemSnapshottersResolver, pluginManager); err != nil { + if err := b.backupper.BackupWithResolvers(backupLog, backup, backupFile, backupItemActionsResolver, pluginManager); err != nil { fatalErrs = append(fatalErrs, err) } diff --git a/pkg/controller/backup_controller_test.go b/pkg/controller/backup_controller_test.go index 89532e9384..e171ddf06a 100644 --- a/pkg/controller/backup_controller_test.go +++ b/pkg/controller/backup_controller_test.go @@ -70,9 +70,8 @@ func (b *fakeBackupper) Backup(logger logrus.FieldLogger, backup *pkgbackup.Requ } func (b *fakeBackupper) BackupWithResolvers(logger logrus.FieldLogger, backup *pkgbackup.Request, backupFile io.Writer, - backupItemActionResolver framework.BackupItemActionResolverV2, itemSnapshotterResolver framework.ItemSnapshotterResolver, - volumeSnapshotterGetter pkgbackup.VolumeSnapshotterGetter) error { - args := b.Called(logger, backup, backupFile, backupItemActionResolver, itemSnapshotterResolver, volumeSnapshotterGetter) + backupItemActionResolver framework.BackupItemActionResolverV2, volumeSnapshotterGetter pkgbackup.VolumeSnapshotterGetter) error { + args := b.Called(logger, backup, backupFile, backupItemActionResolver, volumeSnapshotterGetter) return args.Error(0) } @@ -1047,9 +1046,8 @@ func TestProcessBackupCompletions(t *testing.T) { pluginManager.On("GetBackupItemActionsV2").Return(nil, nil) pluginManager.On("CleanupClients").Return(nil) - pluginManager.On("GetItemSnapshotters").Return(nil, nil) backupper.On("Backup", mock.Anything, mock.Anything, mock.Anything, []biav2.BackupItemAction(nil), pluginManager).Return(nil) - backupper.On("BackupWithResolvers", mock.Anything, mock.Anything, mock.Anything, framework.BackupItemActionResolverV2{}, framework.ItemSnapshotterResolver{}, pluginManager).Return(nil) + backupper.On("BackupWithResolvers", mock.Anything, mock.Anything, mock.Anything, framework.BackupItemActionResolverV2{}, pluginManager).Return(nil) backupStore.On("BackupExists", test.backupLocation.Spec.StorageType.ObjectStorage.Bucket, test.backup.Name).Return(test.backupExists, test.existenceCheckError) // Ensure we have a CompletionTimestamp when uploading and that the backup name matches the backup in the object store. diff --git a/pkg/controller/restore_controller.go b/pkg/controller/restore_controller.go index c49e31bf2d..2600fa4c6b 100644 --- a/pkg/controller/restore_controller.go +++ b/pkg/controller/restore_controller.go @@ -422,12 +422,6 @@ func (r *restoreReconciler) runValidatedRestore(restore *api.Restore, info backu } actionsResolver := framework.NewRestoreItemActionResolverV2(actions) - itemSnapshotters, err := pluginManager.GetItemSnapshotters() - if err != nil { - return errors.Wrap(err, "error getting item snapshotters") - } - snapshotItemResolver := framework.NewItemSnapshotterResolver(itemSnapshotters) - backupFile, err := downloadToTempFile(restore.Spec.BackupName, backupStore, restoreLog) if err != nil { return errors.Wrap(err, "error downloading backup") @@ -466,8 +460,7 @@ func (r *restoreReconciler) runValidatedRestore(restore *api.Restore, info backu VolumeSnapshots: volumeSnapshots, BackupReader: backupFile, } - restoreWarnings, restoreErrors := r.restorer.RestoreWithResolvers(restoreReq, actionsResolver, snapshotItemResolver, - pluginManager) + restoreWarnings, restoreErrors := r.restorer.RestoreWithResolvers(restoreReq, actionsResolver, pluginManager) // log errors and warnings to the restore log for _, msg := range restoreErrors.Velero { diff --git a/pkg/controller/restore_controller_test.go b/pkg/controller/restore_controller_test.go index 5344cac117..65c11d3ac8 100644 --- a/pkg/controller/restore_controller_test.go +++ b/pkg/controller/restore_controller_test.go @@ -41,7 +41,6 @@ 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" - isv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1" riav2 "github.com/vmware-tanzu/velero/pkg/plugin/velero/restoreitemaction/v2" pkgrestore "github.com/vmware-tanzu/velero/pkg/restore" velerotest "github.com/vmware-tanzu/velero/pkg/test" @@ -477,7 +476,6 @@ func TestRestoreReconcile(t *testing.T) { if test.restore != nil { pluginManager.On("GetRestoreItemActionsV2").Return(nil, nil) - pluginManager.On("GetItemSnapshotters").Return([]isv1.ItemSnapshotter{}, nil) pluginManager.On("CleanupClients") } @@ -781,10 +779,9 @@ func (r *fakeRestorer) Restore( func (r *fakeRestorer) RestoreWithResolvers(req *pkgrestore.Request, resolver framework.RestoreItemActionResolverV2, - itemSnapshotterResolver framework.ItemSnapshotterResolver, volumeSnapshotterGetter pkgrestore.VolumeSnapshotterGetter, ) (results.Result, results.Result) { - res := r.Called(req.Log, req.Restore, req.Backup, req.BackupReader, resolver, itemSnapshotterResolver, + res := r.Called(req.Log, req.Restore, req.Backup, req.BackupReader, resolver, r.kbClient, volumeSnapshotterGetter) r.calledWithArg = *req.Restore diff --git a/pkg/plugin/clientmgmt/manager.go b/pkg/plugin/clientmgmt/manager.go index b00e4fbcc7..aafb398a0c 100644 --- a/pkg/plugin/clientmgmt/manager.go +++ b/pkg/plugin/clientmgmt/manager.go @@ -34,7 +34,6 @@ import ( "github.com/vmware-tanzu/velero/pkg/plugin/velero" biav1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v1" biav2 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v2" - isv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1" riav1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/restoreitemaction/v1" riav2 "github.com/vmware-tanzu/velero/pkg/plugin/velero/restoreitemaction/v2" vsv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/volumesnapshotter/v1" @@ -78,12 +77,6 @@ type Manager interface { // GetDeleteItemAction returns the delete item action plugin for name. GetDeleteItemAction(name string) (velero.DeleteItemAction, error) - // GetItemSnapshotter returns the item snapshotter plugin for name - GetItemSnapshotter(name string) (isv1.ItemSnapshotter, error) - - // GetItemSnapshotters returns all item snapshotter plugins - GetItemSnapshotters() ([]isv1.ItemSnapshotter, error) - // CleanupClients terminates all of the Manager's running plugin processes. CleanupClients() } @@ -381,37 +374,6 @@ func (m *manager) GetDeleteItemAction(name string) (velero.DeleteItemAction, err return r, nil } -func (m *manager) GetItemSnapshotter(name string) (isv1.ItemSnapshotter, error) { - name = sanitizeName(name) - - restartableProcess, err := m.getRestartableProcess(common.PluginKindItemSnapshotter, name) - if err != nil { - return nil, err - } - - r := NewRestartableItemSnapshotter(name, restartableProcess) - return r, nil -} - -func (m *manager) GetItemSnapshotters() ([]isv1.ItemSnapshotter, error) { - list := m.registry.List(common.PluginKindItemSnapshotter) - - actions := make([]isv1.ItemSnapshotter, 0, len(list)) - - for i := range list { - id := list[i] - - r, err := m.GetItemSnapshotter(id.Name) - if err != nil { - return nil, err - } - - actions = append(actions, r) - } - - return actions, nil -} - // sanitizeName adds "velero.io" to legacy plugins that weren't namespaced. func sanitizeName(name string) string { // Backwards compatibility with non-namespaced Velero plugins, following principle of least surprise diff --git a/pkg/plugin/clientmgmt/process/client_builder.go b/pkg/plugin/clientmgmt/process/client_builder.go index 2847390757..38c350f033 100644 --- a/pkg/plugin/clientmgmt/process/client_builder.go +++ b/pkg/plugin/clientmgmt/process/client_builder.go @@ -78,7 +78,6 @@ func (b *clientBuilder) clientConfig() *hcplugin.ClientConfig { string(common.PluginKindRestoreItemAction): framework.NewRestoreItemActionPlugin(common.ClientLogger(b.clientLogger)), string(common.PluginKindRestoreItemActionV2): riav2.NewRestoreItemActionPlugin(common.ClientLogger(b.clientLogger)), string(common.PluginKindDeleteItemAction): framework.NewDeleteItemActionPlugin(common.ClientLogger(b.clientLogger)), - string(common.PluginKindItemSnapshotter): framework.NewItemSnapshotterPlugin(common.ClientLogger(b.clientLogger)), }, Logger: b.pluginLogger, Cmd: exec.Command(b.commandName, b.commandArgs...), //nolint diff --git a/pkg/plugin/clientmgmt/process/client_builder_test.go b/pkg/plugin/clientmgmt/process/client_builder_test.go index 2af2b0b740..d822d43cbd 100644 --- a/pkg/plugin/clientmgmt/process/client_builder_test.go +++ b/pkg/plugin/clientmgmt/process/client_builder_test.go @@ -71,7 +71,6 @@ func TestClientConfig(t *testing.T) { string(common.PluginKindRestoreItemAction): framework.NewRestoreItemActionPlugin(common.ClientLogger(logger)), string(common.PluginKindRestoreItemActionV2): riav2.NewRestoreItemActionPlugin(common.ClientLogger(logger)), string(common.PluginKindDeleteItemAction): framework.NewDeleteItemActionPlugin(common.ClientLogger(logger)), - string(common.PluginKindItemSnapshotter): framework.NewItemSnapshotterPlugin(common.ClientLogger(logger)), }, Logger: cb.pluginLogger, Cmd: exec.Command(cb.commandName, cb.commandArgs...), diff --git a/pkg/plugin/clientmgmt/restartable_item_snapshotter.go b/pkg/plugin/clientmgmt/restartable_item_snapshotter.go deleted file mode 100644 index 204d6ca229..0000000000 --- a/pkg/plugin/clientmgmt/restartable_item_snapshotter.go +++ /dev/null @@ -1,131 +0,0 @@ -/* -Copyright the Velero contributors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package clientmgmt - -import ( - "context" - - "github.com/pkg/errors" - - "github.com/vmware-tanzu/velero/pkg/plugin/clientmgmt/process" - "github.com/vmware-tanzu/velero/pkg/plugin/framework/common" - "github.com/vmware-tanzu/velero/pkg/plugin/velero" - isv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1" -) - -type restartableItemSnapshotter struct { - key process.KindAndName - sharedPluginProcess process.RestartableProcess -} - -// NewRestartableItemSnapshotter returns a new restartableItemSnapshotter. -func NewRestartableItemSnapshotter(name string, sharedPluginProcess process.RestartableProcess) *restartableItemSnapshotter { - r := &restartableItemSnapshotter{ - key: process.KindAndName{Kind: common.PluginKindItemSnapshotter, Name: name}, - sharedPluginProcess: sharedPluginProcess, - } - return r -} - -// getItemSnapshotter returns the item snapshotter for this restartableItemSnapshotter. It does *not* restart the -// plugin process. -func (r *restartableItemSnapshotter) getItemSnapshotter() (isv1.ItemSnapshotter, error) { - plugin, err := r.sharedPluginProcess.GetByKindAndName(r.key) - if err != nil { - return nil, err - } - - itemSnapshotter, ok := plugin.(isv1.ItemSnapshotter) - if !ok { - return nil, errors.Errorf("%T is not an ItemSnapshotter!", plugin) - } - - return itemSnapshotter, nil -} - -// getDelegate restarts the plugin process (if needed) and returns the item snapshotter for this restartableItemSnapshotter. -func (r *restartableItemSnapshotter) getDelegate() (isv1.ItemSnapshotter, error) { - if err := r.sharedPluginProcess.ResetIfNeeded(); err != nil { - return nil, err - } - - return r.getItemSnapshotter() -} - -func (r *restartableItemSnapshotter) Init(config map[string]string) error { - delegate, err := r.getDelegate() - if err != nil { - return err - } - - return delegate.Init(config) -} - -// AppliesTo restarts the plugin's process if needed, then delegates the call. -func (r *restartableItemSnapshotter) AppliesTo() (velero.ResourceSelector, error) { - delegate, err := r.getDelegate() - if err != nil { - return velero.ResourceSelector{}, err - } - - return delegate.AppliesTo() -} - -func (r *restartableItemSnapshotter) AlsoHandles(input *isv1.AlsoHandlesInput) ([]velero.ResourceIdentifier, error) { - delegate, err := r.getDelegate() - if err != nil { - return nil, err - } - - return delegate.AlsoHandles(input) -} - -func (r *restartableItemSnapshotter) SnapshotItem(ctx context.Context, input *isv1.SnapshotItemInput) (*isv1.SnapshotItemOutput, error) { - delegate, err := r.getDelegate() - if err != nil { - return nil, err - } - - return delegate.SnapshotItem(ctx, input) -} - -func (r *restartableItemSnapshotter) Progress(input *isv1.ProgressInput) (*isv1.ProgressOutput, error) { - delegate, err := r.getDelegate() - if err != nil { - return nil, err - } - - return delegate.Progress(input) -} - -func (r *restartableItemSnapshotter) DeleteSnapshot(ctx context.Context, input *isv1.DeleteSnapshotInput) error { - delegate, err := r.getDelegate() - if err != nil { - return err - } - - return delegate.DeleteSnapshot(ctx, input) -} - -func (r *restartableItemSnapshotter) CreateItemFromSnapshot(ctx context.Context, input *isv1.CreateItemInput) (*isv1.CreateItemOutput, error) { - delegate, err := r.getDelegate() - if err != nil { - return nil, err - } - - return delegate.CreateItemFromSnapshot(ctx, input) -} diff --git a/pkg/plugin/clientmgmt/restartable_item_snapshotter_test.go b/pkg/plugin/clientmgmt/restartable_item_snapshotter_test.go deleted file mode 100644 index 26f5a51db6..0000000000 --- a/pkg/plugin/clientmgmt/restartable_item_snapshotter_test.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -Copyright the Velero contributors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package clientmgmt - -import ( - "context" - "testing" - "time" - - "github.com/pkg/errors" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime/schema" - - "github.com/vmware-tanzu/velero/internal/restartabletest" - v1 "github.com/vmware-tanzu/velero/pkg/apis/velero/v1" - "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1/mocks" - - "github.com/vmware-tanzu/velero/pkg/plugin/clientmgmt/process" - "github.com/vmware-tanzu/velero/pkg/plugin/framework/common" - "github.com/vmware-tanzu/velero/pkg/plugin/velero" - isv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1" -) - -func TestRestartableGetItemSnapshotter(t *testing.T) { - tests := []struct { - name string - plugin interface{} - getError error - expectedError string - }{ - { - name: "error getting by kind and name", - getError: errors.Errorf("get error"), - expectedError: "get error", - }, - { - name: "wrong type", - plugin: 3, - expectedError: "int is not an ItemSnapshotter!", - }, - { - name: "happy path", - plugin: new(mocks.ItemSnapshotter), - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - p := new(restartabletest.MockRestartableProcess) - defer p.AssertExpectations(t) - - name := "pvc" - key := process.KindAndName{Kind: common.PluginKindItemSnapshotter, Name: name} - p.On("GetByKindAndName", key).Return(tc.plugin, tc.getError) - - r := NewRestartableItemSnapshotter(name, p) - a, err := r.getItemSnapshotter() - if tc.expectedError != "" { - assert.EqualError(t, err, tc.expectedError) - return - } - require.NoError(t, err) - - assert.Equal(t, tc.plugin, a) - }) - } -} - -func TestRestartableItemSnapshotterGetDelegate(t *testing.T) { - p := new(restartabletest.MockRestartableProcess) - defer p.AssertExpectations(t) - - // Reset error - p.On("ResetIfNeeded").Return(errors.Errorf("reset error")).Once() - name := "pvc" - r := NewRestartableItemSnapshotter(name, p) - a, err := r.getDelegate() - assert.Nil(t, a) - assert.EqualError(t, err, "reset error") - - // Happy path - p.On("ResetIfNeeded").Return(nil) - expected := new(mocks.ItemSnapshotter) - key := process.KindAndName{Kind: common.PluginKindItemSnapshotter, Name: name} - p.On("GetByKindAndName", key).Return(expected, nil) - - a, err = r.getDelegate() - assert.NoError(t, err) - assert.Equal(t, expected, a) -} - -func TestRestartableItemSnasphotterDelegatedFunctions(t *testing.T) { - b := new(v1.Backup) - - pv := &unstructured.Unstructured{ - Object: map[string]interface{}{ - "color": "blue", - }, - } - - sii := &isv1.SnapshotItemInput{ - Item: pv, - Params: nil, - Backup: b, - } - - ctx := context.Background() - - pvToReturn := &unstructured.Unstructured{ - Object: map[string]interface{}{ - "color": "green", - }, - } - - additionalItems := []velero.ResourceIdentifier{ - { - GroupResource: schema.GroupResource{Group: "velero.io", Resource: "backups"}, - }, - } - - sio := &isv1.SnapshotItemOutput{ - UpdatedItem: pvToReturn, - SnapshotID: "", - SnapshotMetadata: nil, - AdditionalItems: additionalItems, - HandledItems: nil, - } - - cii := &isv1.CreateItemInput{ - SnapshottedItem: nil, - SnapshotID: "", - ItemFromBackup: nil, - SnapshotMetadata: nil, - Params: nil, - Restore: nil, - } - - cio := &isv1.CreateItemOutput{ - UpdatedItem: nil, - AdditionalItems: nil, - SkipRestore: false, - } - - pi := &isv1.ProgressInput{ - ItemID: velero.ResourceIdentifier{}, - SnapshotID: "", - Backup: nil, - } - po := &isv1.ProgressOutput{ - Phase: isv1.SnapshotPhaseInProgress, - Err: "", - ItemsCompleted: 0, - ItemsToComplete: 0, - Started: time.Time{}, - Updated: time.Time{}, - } - dsi := &isv1.DeleteSnapshotInput{ - SnapshotID: "", - ItemFromBackup: nil, - SnapshotMetadata: nil, - Params: nil, - } - restartabletest.RunRestartableDelegateTests( - t, - common.PluginKindItemSnapshotter, - func(key process.KindAndName, p process.RestartableProcess) interface{} { - return &restartableItemSnapshotter{ - key: key, - sharedPluginProcess: p, - } - }, - func() restartabletest.Mockable { - return new(mocks.ItemSnapshotter) - }, - restartabletest.RestartableDelegateTest{ - Function: "Init", - Inputs: []interface{}{map[string]string{}}, - ExpectedErrorOutputs: []interface{}{errors.Errorf("reset error")}, - ExpectedDelegateOutputs: []interface{}{errors.Errorf("delegate error")}, - }, - restartabletest.RestartableDelegateTest{ - Function: "AppliesTo", - Inputs: []interface{}{}, - ExpectedErrorOutputs: []interface{}{velero.ResourceSelector{}, errors.Errorf("reset error")}, - ExpectedDelegateOutputs: []interface{}{velero.ResourceSelector{IncludedNamespaces: []string{"a"}}, errors.Errorf("delegate error")}, - }, - restartabletest.RestartableDelegateTest{ - Function: "AlsoHandles", - Inputs: []interface{}{&isv1.AlsoHandlesInput{}}, - ExpectedErrorOutputs: []interface{}{[]velero.ResourceIdentifier(nil), errors.Errorf("reset error")}, - ExpectedDelegateOutputs: []interface{}{[]velero.ResourceIdentifier(nil), errors.Errorf("delegate error")}, - }, - restartabletest.RestartableDelegateTest{ - Function: "SnapshotItem", - Inputs: []interface{}{ctx, sii}, - ExpectedErrorOutputs: []interface{}{nil, errors.Errorf("reset error")}, - ExpectedDelegateOutputs: []interface{}{sio, errors.Errorf("delegate error")}, - }, - restartabletest.RestartableDelegateTest{ - Function: "CreateItemFromSnapshot", - Inputs: []interface{}{ctx, cii}, - ExpectedErrorOutputs: []interface{}{nil, errors.Errorf("reset error")}, - ExpectedDelegateOutputs: []interface{}{cio, errors.Errorf("delegate error")}, - }, - restartabletest.RestartableDelegateTest{ - Function: "Progress", - Inputs: []interface{}{pi}, - ExpectedErrorOutputs: []interface{}{nil, errors.Errorf("reset error")}, - ExpectedDelegateOutputs: []interface{}{po, errors.Errorf("delegate error")}, - }, - restartabletest.RestartableDelegateTest{ - Function: "DeleteSnapshot", - Inputs: []interface{}{ctx, dsi}, - ExpectedErrorOutputs: []interface{}{errors.Errorf("reset error")}, - ExpectedDelegateOutputs: []interface{}{errors.Errorf("delegate error")}, - }, - ) -} diff --git a/pkg/plugin/framework/action_resolver.go b/pkg/plugin/framework/action_resolver.go index a03f197d0f..4b79fea9cf 100644 --- a/pkg/plugin/framework/action_resolver.go +++ b/pkg/plugin/framework/action_resolver.go @@ -27,7 +27,6 @@ import ( "github.com/vmware-tanzu/velero/pkg/plugin/velero" biav1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v1" biav2 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v2" - isv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1" riav1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/restoreitemaction/v1" riav2 "github.com/vmware-tanzu/velero/pkg/plugin/velero/restoreitemaction/v2" "github.com/vmware-tanzu/velero/pkg/util/collections" @@ -141,12 +140,6 @@ func NewDeleteItemActionResolver(actions []velero.DeleteItemAction) DeleteItemAc } } -func NewItemSnapshotterResolver(actions []isv1.ItemSnapshotter) ItemSnapshotterResolver { - return ItemSnapshotterResolver{ - actions: actions, - } -} - type ActionResolver interface { ResolveAction(helper discovery.Helper, action velero.Applicable, log logrus.FieldLogger) (ResolvedAction, error) } @@ -287,32 +280,3 @@ func (recv DeleteItemActionResolver) ResolveActions(helper discovery.Helper, log } return resolved, nil } - -type ItemSnapshotterResolvedAction struct { - isv1.ItemSnapshotter - resolvedAction -} - -type ItemSnapshotterResolver struct { - actions []isv1.ItemSnapshotter -} - -func (recv ItemSnapshotterResolver) ResolveActions(helper discovery.Helper, log logrus.FieldLogger) ([]ItemSnapshotterResolvedAction, error) { - var resolved []ItemSnapshotterResolvedAction - for _, action := range recv.actions { - resources, namespaces, selector, err := resolveAction(helper, action) - if err != nil { - return nil, err - } - res := ItemSnapshotterResolvedAction{ - ItemSnapshotter: action, - resolvedAction: resolvedAction{ - ResourceIncludesExcludes: resources, - NamespaceIncludesExcludes: namespaces, - Selector: selector, - }, - } - resolved = append(resolved, res) - } - return resolved, nil -} diff --git a/pkg/plugin/framework/common/plugin_kinds.go b/pkg/plugin/framework/common/plugin_kinds.go index 3f567418d5..bba4697e0e 100644 --- a/pkg/plugin/framework/common/plugin_kinds.go +++ b/pkg/plugin/framework/common/plugin_kinds.go @@ -47,9 +47,6 @@ const ( // PluginKindDeleteItemAction represents a delete item action plugin. PluginKindDeleteItemAction PluginKind = "DeleteItemAction" - // PluginKindItemSnapshotter represents an item snapshotter plugin - PluginKindItemSnapshotter PluginKind = "ItemSnapshotter" - // PluginKindPluginLister represents a plugin lister plugin. PluginKindPluginLister PluginKind = "PluginLister" ) @@ -73,6 +70,5 @@ func AllPluginKinds() map[string]PluginKind { allPluginKinds[PluginKindRestoreItemAction.String()] = PluginKindRestoreItemAction allPluginKinds[PluginKindRestoreItemActionV2.String()] = PluginKindRestoreItemActionV2 allPluginKinds[PluginKindDeleteItemAction.String()] = PluginKindDeleteItemAction - allPluginKinds[PluginKindItemSnapshotter.String()] = PluginKindItemSnapshotter return allPluginKinds } diff --git a/pkg/plugin/framework/item_snapshotter.go b/pkg/plugin/framework/item_snapshotter.go deleted file mode 100644 index f9af50e68c..0000000000 --- a/pkg/plugin/framework/item_snapshotter.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright the Velero contributors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package framework - -import ( - plugin "github.com/hashicorp/go-plugin" - "golang.org/x/net/context" - "google.golang.org/grpc" - - "github.com/vmware-tanzu/velero/pkg/plugin/framework/common" - proto "github.com/vmware-tanzu/velero/pkg/plugin/generated" -) - -// ItemSnapshotterPlugin is an implementation of go-plugin's Plugin -// interface with support for gRPC for the ItemSnapshotter -// interface. -type ItemSnapshotterPlugin struct { - plugin.NetRPCUnsupportedPlugin - *common.PluginBase -} - -// GRPCClient returns a clientDispenser for ItemSnapshotter gRPC clients. -func (p *ItemSnapshotterPlugin) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, clientConn *grpc.ClientConn) (interface{}, error) { - return common.NewClientDispenser(p.ClientLogger, clientConn, newItemSnapshotterGRPCClient), nil -} - -// GRPCServer registers an ItemSnapshotter gRPC server. -func (p *ItemSnapshotterPlugin) GRPCServer(_ *plugin.GRPCBroker, server *grpc.Server) error { - proto.RegisterItemSnapshotterServer(server, &ItemSnapshotterGRPCServer{mux: p.ServerMux}) - return nil -} diff --git a/pkg/plugin/framework/item_snapshotter_client.go b/pkg/plugin/framework/item_snapshotter_client.go deleted file mode 100644 index 323c3541b3..0000000000 --- a/pkg/plugin/framework/item_snapshotter_client.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -Copyright the Velero contributors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package framework - -import ( - "context" - "encoding/json" - "time" - - "github.com/pkg/errors" - "google.golang.org/grpc" - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - - "github.com/vmware-tanzu/velero/pkg/plugin/framework/common" - 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. -func NewItemSnapshotterPlugin(options ...common.PluginOption) *ItemSnapshotterPlugin { - return &ItemSnapshotterPlugin{ - PluginBase: common.NewPluginBase(options...), - } -} - -func newItemSnapshotterGRPCClient(base *common.ClientBase, clientConn *grpc.ClientConn) interface{} { - return &ItemSnapshotterGRPCClient{ - ClientBase: base, - grpcClient: proto.NewItemSnapshotterClient(clientConn), - } -} - -// ItemSnapshotterGRPCClient implements the ItemSnapshotter interface and uses a -// gRPC client to make calls to the plugin server. -type ItemSnapshotterGRPCClient struct { - *common.ClientBase - grpcClient proto.ItemSnapshotterClient -} - -func (recv ItemSnapshotterGRPCClient) Init(config map[string]string) error { - req := &proto.ItemSnapshotterInitRequest{ - Plugin: recv.Plugin, - Config: config, - } - - _, err := recv.grpcClient.Init(context.Background(), req) - return err -} - -func (recv ItemSnapshotterGRPCClient) AppliesTo() (velero.ResourceSelector, error) { - req := &proto.ItemSnapshotterAppliesToRequest{ - Plugin: recv.Plugin, - } - - res, err := recv.grpcClient.AppliesTo(context.Background(), req) - if err != nil { - return velero.ResourceSelector{}, common.FromGRPCError(err) - } - - if res.ResourceSelector == nil { - return velero.ResourceSelector{}, nil - } - - return velero.ResourceSelector{ - IncludedNamespaces: res.ResourceSelector.IncludedNamespaces, - ExcludedNamespaces: res.ResourceSelector.ExcludedNamespaces, - IncludedResources: res.ResourceSelector.IncludedResources, - ExcludedResources: res.ResourceSelector.ExcludedResources, - LabelSelector: res.ResourceSelector.Selector, - }, nil -} - -func (recv ItemSnapshotterGRPCClient) AlsoHandles(input *isv1.AlsoHandlesInput) ([]velero.ResourceIdentifier, error) { - itemJSON, err := json.Marshal(input.Item.UnstructuredContent()) - if err != nil { - return nil, errors.WithStack(err) - } - - backupJSON, err := json.Marshal(input.Backup) - if err != nil { - return nil, errors.WithStack(err) - } - req := &proto.AlsoHandlesRequest{ - Plugin: recv.Plugin, - Item: itemJSON, - Backup: backupJSON, - } - res, err := recv.grpcClient.AlsoHandles(context.Background(), req) - if err != nil { - return nil, errors.WithStack(err) - } - - handledItems := unpackResourceIdentifiers(res.HandledItems) - - return handledItems, nil -} - -func (recv ItemSnapshotterGRPCClient) SnapshotItem(ctx context.Context, input *isv1.SnapshotItemInput) (*isv1.SnapshotItemOutput, error) { - itemJSON, err := json.Marshal(input.Item.UnstructuredContent()) - if err != nil { - return nil, errors.WithStack(err) - } - - backupJSON, err := json.Marshal(input.Backup) - if err != nil { - return nil, errors.WithStack(err) - } - req := &proto.SnapshotItemRequest{ - Plugin: recv.Plugin, - Item: itemJSON, - Backup: backupJSON, - } - res, err := recv.grpcClient.SnapshotItem(ctx, req) - if err != nil { - return nil, errors.WithStack(err) - } - var updatedItem unstructured.Unstructured - if err := json.Unmarshal(res.Item, &updatedItem); err != nil { - return nil, errors.WithStack(err) - } - - additionalItems := unpackResourceIdentifiers(res.AdditionalItems) - handledItems := unpackResourceIdentifiers(res.HandledItems) - - sio := isv1.SnapshotItemOutput{ - UpdatedItem: &updatedItem, - SnapshotID: res.SnapshotID, - SnapshotMetadata: res.SnapshotMetadata, - AdditionalItems: additionalItems, - HandledItems: handledItems, - } - return &sio, nil -} - -func (recv ItemSnapshotterGRPCClient) Progress(input *isv1.ProgressInput) (*isv1.ProgressOutput, error) { - backupJSON, err := json.Marshal(input.Backup) - if err != nil { - return nil, errors.WithStack(err) - } - req := &proto.ProgressRequest{ - Plugin: recv.Plugin, - ItemID: resourceIdentifierToProto(input.ItemID), - SnapshotID: input.SnapshotID, - Backup: backupJSON, - } - - res, err := recv.grpcClient.Progress(context.Background(), req) - - if err != nil { - return nil, errors.WithStack(err) - } - // Validate phase - - phase, err := isv1.SnapshotPhaseFromString(res.Phase) - if err != nil { - return nil, errors.WithStack(err) - } - - up := isv1.ProgressOutput{ - Phase: phase, - Err: res.Err, - ItemsCompleted: res.ItemsCompleted, - ItemsToComplete: res.ItemsToComplete, - Started: time.Unix(res.Started, res.StartedNano), - Updated: time.Unix(res.Updated, res.UpdatedNano), - } - return &up, nil -} - -func (recv ItemSnapshotterGRPCClient) DeleteSnapshot(ctx context.Context, input *isv1.DeleteSnapshotInput) error { - req := &proto.DeleteItemSnapshotRequest{ - Plugin: recv.Plugin, - Params: input.Params, - SnapshotID: input.SnapshotID, - } - _, err := recv.grpcClient.DeleteSnapshot(ctx, req) // Returns Empty as first arg so just ignore - - if err != nil { - return errors.WithStack(err) - } - return nil -} - -func (recv ItemSnapshotterGRPCClient) CreateItemFromSnapshot(ctx context.Context, input *isv1.CreateItemInput) (*isv1.CreateItemOutput, error) { - itemJSON, err := json.Marshal(input.SnapshottedItem.UnstructuredContent()) - if err != nil { - return nil, errors.WithStack(err) - } - itemFromBackupJSON, err := json.Marshal(input.ItemFromBackup.UnstructuredContent()) - if err != nil { - return nil, errors.WithStack(err) - } - restoreJSON, err := json.Marshal(input.Restore) - if err != nil { - return nil, errors.WithStack(err) - } - req := &proto.CreateItemFromSnapshotRequest{ - Plugin: recv.Plugin, - Item: itemJSON, - SnapshotID: input.SnapshotID, - ItemFromBackup: itemFromBackupJSON, - SnapshotMetadata: input.SnapshotMetadata, - Params: input.Params, - Restore: restoreJSON, - } - - res, err := recv.grpcClient.CreateItemFromSnapshot(ctx, req) - if err != nil { - return nil, errors.WithStack(err) - } - - var updatedItem unstructured.Unstructured - if err := json.Unmarshal(res.Item, &updatedItem); err != nil { - return nil, errors.WithStack(err) - } - - additionalItems := unpackResourceIdentifiers(res.AdditionalItems) - - cio := isv1.CreateItemOutput{ - UpdatedItem: &updatedItem, - AdditionalItems: additionalItems, - SkipRestore: res.SkipRestore, - } - return &cio, nil -} diff --git a/pkg/plugin/framework/item_snapshotter_server.go b/pkg/plugin/framework/item_snapshotter_server.go deleted file mode 100644 index 21ab92110f..0000000000 --- a/pkg/plugin/framework/item_snapshotter_server.go +++ /dev/null @@ -1,312 +0,0 @@ -/* -Copyright the Velero contributors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -package framework - -import ( - "context" - "encoding/json" - - isv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1" - - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - - api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1" - - "github.com/pkg/errors" - - "github.com/vmware-tanzu/velero/pkg/plugin/framework/common" - proto "github.com/vmware-tanzu/velero/pkg/plugin/generated" -) - -// ItemSnapshotterGRPCServer implements the proto-generated ItemSnapshotterServer interface, and accepts -// gRPC calls and forwards them to an implementation of the pluggable interface. -type ItemSnapshotterGRPCServer struct { - mux *common.ServerMux -} - -func (recv *ItemSnapshotterGRPCServer) getImpl(name string) (isv1.ItemSnapshotter, error) { - impl, err := recv.mux.GetHandler(name) - if err != nil { - return nil, err - } - - itemAction, ok := impl.(isv1.ItemSnapshotter) - if !ok { - return nil, errors.Errorf("%T is not an item snapshotter", impl) - } - - return itemAction, nil -} - -func (recv *ItemSnapshotterGRPCServer) Init(c context.Context, req *proto.ItemSnapshotterInitRequest) (response *proto.Empty, err error) { - defer func() { - if recoveredErr := common.HandlePanic(recover()); recoveredErr != nil { - err = recoveredErr - } - }() - - impl, err := recv.getImpl(req.Plugin) - if err != nil { - return nil, common.NewGRPCError(err) - } - - err = impl.Init(req.Config) - if err != nil { - return nil, common.NewGRPCError(err) - } - - return &proto.Empty{}, nil -} - -func (recv *ItemSnapshotterGRPCServer) AppliesTo(ctx context.Context, req *proto.ItemSnapshotterAppliesToRequest) (response *proto.ItemSnapshotterAppliesToResponse, err error) { - defer func() { - if recoveredErr := common.HandlePanic(recover()); recoveredErr != nil { - err = recoveredErr - } - }() - - impl, err := recv.getImpl(req.Plugin) - if err != nil { - return nil, common.NewGRPCError(err) - } - - resourceSelector, err := impl.AppliesTo() - if err != nil { - return nil, common.NewGRPCError(err) - } - - return &proto.ItemSnapshotterAppliesToResponse{ - ResourceSelector: &proto.ResourceSelector{ - IncludedNamespaces: resourceSelector.IncludedNamespaces, - ExcludedNamespaces: resourceSelector.ExcludedNamespaces, - IncludedResources: resourceSelector.IncludedResources, - ExcludedResources: resourceSelector.ExcludedResources, - Selector: resourceSelector.LabelSelector, - }, - }, nil -} - -func (recv *ItemSnapshotterGRPCServer) AlsoHandles(ctx context.Context, req *proto.AlsoHandlesRequest) (res *proto.AlsoHandlesResponse, err error) { - defer func() { - if recoveredErr := common.HandlePanic(recover()); recoveredErr != nil { - err = recoveredErr - } - }() - - impl, err := recv.getImpl(req.Plugin) - if err != nil { - return nil, common.NewGRPCError(err) - } - var item unstructured.Unstructured - var backup api.Backup - - if err := json.Unmarshal(req.Item, &item); err != nil { - return nil, common.NewGRPCError(errors.WithStack(err)) - } - if err := json.Unmarshal(req.Backup, &backup); err != nil { - return nil, common.NewGRPCError(errors.WithStack(err)) - } - ahi := isv1.AlsoHandlesInput{ - Item: &item, - Backup: &backup, - } - alsoHandles, err := impl.AlsoHandles(&ahi) - if err != nil { - return nil, common.NewGRPCError(err) - } - res = &proto.AlsoHandlesResponse{} - - for _, item := range alsoHandles { - res.HandledItems = append(res.HandledItems, resourceIdentifierToProto(item)) - } - return res, nil -} - -func (recv *ItemSnapshotterGRPCServer) SnapshotItem(ctx context.Context, req *proto.SnapshotItemRequest) (res *proto.SnapshotItemResponse, err error) { - defer func() { - if recoveredErr := common.HandlePanic(recover()); recoveredErr != nil { - err = recoveredErr - } - }() - - impl, err := recv.getImpl(req.Plugin) - if err != nil { - return nil, common.NewGRPCError(err) - } - var item unstructured.Unstructured - var backup api.Backup - - if err := json.Unmarshal(req.Item, &item); err != nil { - return nil, common.NewGRPCError(errors.WithStack(err)) - } - if err := json.Unmarshal(req.Backup, &backup); err != nil { - return nil, common.NewGRPCError(errors.WithStack(err)) - } - sii := isv1.SnapshotItemInput{ - Item: &item, - Params: req.Params, - Backup: &backup, - } - sio, err := impl.SnapshotItem(ctx, &sii) - - // If the plugin implementation returned a nil updatedItem (meaning no modifications), reset updatedItem to the - // original item. - var updatedItemJSON []byte - if sio.UpdatedItem == nil { - updatedItemJSON = req.Item - } else { - updatedItemJSON, err = json.Marshal(sio.UpdatedItem.UnstructuredContent()) - if err != nil { - return nil, common.NewGRPCError(errors.WithStack(err)) - } - } - res = &proto.SnapshotItemResponse{ - Item: updatedItemJSON, - SnapshotID: sio.SnapshotID, - SnapshotMetadata: sio.SnapshotMetadata, - } - res.AdditionalItems = packResourceIdentifiers(sio.AdditionalItems) - res.HandledItems = packResourceIdentifiers(sio.HandledItems) - return res, err -} - -func (recv *ItemSnapshotterGRPCServer) Progress(ctx context.Context, req *proto.ProgressRequest) (res *proto.ProgressResponse, err error) { - defer func() { - if recoveredErr := common.HandlePanic(recover()); recoveredErr != nil { - err = recoveredErr - } - }() - impl, err := recv.getImpl(req.Plugin) - if err != nil { - return nil, common.NewGRPCError(err) - } - var backup api.Backup - - if err := json.Unmarshal(req.Backup, &backup); err != nil { - return nil, common.NewGRPCError(errors.WithStack(err)) - } - sipi := &isv1.ProgressInput{ - ItemID: protoToResourceIdentifier(req.ItemID), - SnapshotID: req.SnapshotID, - Backup: &backup, - } - - sipo, err := impl.Progress(sipi) - if err != nil { - return nil, common.NewGRPCError(err) - } - - res = &proto.ProgressResponse{ - Phase: string(sipo.Phase), - ItemsCompleted: sipo.ItemsCompleted, - ItemsToComplete: sipo.ItemsToComplete, - Started: sipo.Started.Unix(), - StartedNano: sipo.Started.UnixNano(), - Updated: sipo.Updated.Unix(), - UpdatedNano: sipo.Updated.UnixNano(), - Err: sipo.Err, - } - return res, nil -} - -func (recv *ItemSnapshotterGRPCServer) DeleteSnapshot(ctx context.Context, req *proto.DeleteItemSnapshotRequest) (empty *proto.Empty, err error) { - defer func() { - if recoveredErr := common.HandlePanic(recover()); recoveredErr != nil { - err = recoveredErr - } - }() - impl, err := recv.getImpl(req.Plugin) - if err != nil { - return nil, common.NewGRPCError(err) - } - - var itemFromBackup unstructured.Unstructured - if err := json.Unmarshal(req.ItemFromBackup, &itemFromBackup); err != nil { - return nil, common.NewGRPCError(errors.WithStack(err)) - } - - disi := isv1.DeleteSnapshotInput{ - SnapshotID: req.SnapshotID, - ItemFromBackup: &itemFromBackup, - SnapshotMetadata: req.Metadata, - Params: req.Params, - } - - err = impl.DeleteSnapshot(ctx, &disi) - if err != nil { - return nil, common.NewGRPCError(err) - } - return -} - -func (recv *ItemSnapshotterGRPCServer) CreateItemFromSnapshot(ctx context.Context, req *proto.CreateItemFromSnapshotRequest) (res *proto.CreateItemFromSnapshotResponse, err error) { - defer func() { - if recoveredErr := common.HandlePanic(recover()); recoveredErr != nil { - err = recoveredErr - } - }() - impl, err := recv.getImpl(req.Plugin) - if err != nil { - return nil, common.NewGRPCError(err) - } - - var snapshottedItem unstructured.Unstructured - if err := json.Unmarshal(req.Item, &snapshottedItem); err != nil { - return nil, common.NewGRPCError(errors.WithStack(err)) - } - - var itemFromBackup unstructured.Unstructured - if err := json.Unmarshal(req.Item, &itemFromBackup); err != nil { - return nil, common.NewGRPCError(errors.WithStack(err)) - } - - var restore api.Restore - - if err := json.Unmarshal(req.Restore, &restore); err != nil { - return nil, common.NewGRPCError(errors.WithStack(err)) - } - - cii := isv1.CreateItemInput{ - SnapshottedItem: &snapshottedItem, - SnapshotID: req.SnapshotID, - ItemFromBackup: &itemFromBackup, - SnapshotMetadata: req.SnapshotMetadata, - Params: req.Params, - Restore: &restore, - } - - cio, err := impl.CreateItemFromSnapshot(ctx, &cii) - if err != nil { - return nil, common.NewGRPCError(err) - } - - var updatedItemJSON []byte - if cio.UpdatedItem == nil { - updatedItemJSON = req.Item - } else { - updatedItemJSON, err = json.Marshal(cio.UpdatedItem.UnstructuredContent()) - if err != nil { - return nil, common.NewGRPCError(errors.WithStack(err)) - } - } - res = &proto.CreateItemFromSnapshotResponse{ - Item: updatedItemJSON, - SkipRestore: cio.SkipRestore, - } - res.AdditionalItems = packResourceIdentifiers(cio.AdditionalItems) - - return -} diff --git a/pkg/plugin/framework/plugin_types_test.go b/pkg/plugin/framework/plugin_types_test.go index 2ebb78104f..f9b4d1f809 100644 --- a/pkg/plugin/framework/plugin_types_test.go +++ b/pkg/plugin/framework/plugin_types_test.go @@ -30,7 +30,6 @@ func TestPluginImplementationsAreGRPCPlugins(t *testing.T) { new(ObjectStorePlugin), new(PluginListerPlugin), new(RestoreItemActionPlugin), - new(ItemSnapshotterPlugin), } for _, impl := range pluginImpls { diff --git a/pkg/plugin/framework/server.go b/pkg/plugin/framework/server.go index e84df612af..4fdae230a6 100644 --- a/pkg/plugin/framework/server.go +++ b/pkg/plugin/framework/server.go @@ -90,11 +90,6 @@ type Server interface { // RegisterDeleteItemActions registers multiple Delete item actions. RegisterDeleteItemActions(map[string]common.HandlerInitializer) Server - RegisterItemSnapshotter(pluginName string, initializer common.HandlerInitializer) Server - - // RegisterItemSnapshotters registers multiple Item Snapshotters - RegisterItemSnapshotters(map[string]common.HandlerInitializer) Server - // Server runs the plugin server. Serve() } @@ -111,7 +106,6 @@ type server struct { restoreItemAction *RestoreItemActionPlugin restoreItemActionV2 *riav2.RestoreItemActionPlugin deleteItemAction *DeleteItemActionPlugin - itemSnapshotter *ItemSnapshotterPlugin } // NewServer returns a new Server @@ -128,7 +122,6 @@ func NewServer() Server { restoreItemAction: NewRestoreItemActionPlugin(common.ServerLogger(log)), restoreItemActionV2: riav2.NewRestoreItemActionPlugin(common.ServerLogger(log)), deleteItemAction: NewDeleteItemActionPlugin(common.ServerLogger(log)), - itemSnapshotter: NewItemSnapshotterPlugin(common.ServerLogger(log)), } } @@ -224,17 +217,6 @@ func (s *server) RegisterDeleteItemActions(m map[string]common.HandlerInitialize return s } -func (s *server) RegisterItemSnapshotter(name string, initializer common.HandlerInitializer) Server { - s.itemSnapshotter.Register(name, initializer) - return s -} -func (s *server) RegisterItemSnapshotters(m map[string]common.HandlerInitializer) Server { - for name := range m { - s.RegisterItemSnapshotter(name, m[name]) - } - return s -} - // getNames returns a list of PluginIdentifiers registered with plugin. func getNames(command string, kind common.PluginKind, plugin Interface) []PluginIdentifier { var pluginIdentifiers []PluginIdentifier @@ -266,7 +248,6 @@ func (s *server) Serve() { pluginIdentifiers = append(pluginIdentifiers, getNames(command, common.PluginKindRestoreItemAction, s.restoreItemAction)...) pluginIdentifiers = append(pluginIdentifiers, getNames(command, common.PluginKindRestoreItemActionV2, s.restoreItemActionV2)...) pluginIdentifiers = append(pluginIdentifiers, getNames(command, common.PluginKindDeleteItemAction, s.deleteItemAction)...) - pluginIdentifiers = append(pluginIdentifiers, getNames(command, common.PluginKindItemSnapshotter, s.itemSnapshotter)...) pluginLister := NewPluginLister(pluginIdentifiers...) @@ -281,7 +262,6 @@ func (s *server) Serve() { string(common.PluginKindRestoreItemAction): s.restoreItemAction, string(common.PluginKindRestoreItemActionV2): s.restoreItemActionV2, string(common.PluginKindDeleteItemAction): s.deleteItemAction, - string(common.PluginKindItemSnapshotter): s.itemSnapshotter, }, GRPCServer: plugin.DefaultGRPCServer, }) diff --git a/pkg/plugin/generated/ItemSnapshotter.pb.go b/pkg/plugin/generated/ItemSnapshotter.pb.go deleted file mode 100644 index f1fdf27c4a..0000000000 --- a/pkg/plugin/generated/ItemSnapshotter.pb.go +++ /dev/null @@ -1,1603 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.23.0 -// protoc v3.14.0 -// source: ItemSnapshotter.proto - -package generated - -import ( - context "context" - proto "github.com/golang/protobuf/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -// This is a compile-time assertion that a sufficiently up-to-date version -// of the legacy proto package is being used. -const _ = proto.ProtoPackageIsVersion4 - -type ItemSnapshotterAppliesToRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Plugin string `protobuf:"bytes,1,opt,name=plugin,proto3" json:"plugin,omitempty"` -} - -func (x *ItemSnapshotterAppliesToRequest) Reset() { - *x = ItemSnapshotterAppliesToRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ItemSnapshotter_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ItemSnapshotterAppliesToRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ItemSnapshotterAppliesToRequest) ProtoMessage() {} - -func (x *ItemSnapshotterAppliesToRequest) ProtoReflect() protoreflect.Message { - mi := &file_ItemSnapshotter_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ItemSnapshotterAppliesToRequest.ProtoReflect.Descriptor instead. -func (*ItemSnapshotterAppliesToRequest) Descriptor() ([]byte, []int) { - return file_ItemSnapshotter_proto_rawDescGZIP(), []int{0} -} - -func (x *ItemSnapshotterAppliesToRequest) GetPlugin() string { - if x != nil { - return x.Plugin - } - return "" -} - -type ItemSnapshotterAppliesToResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ResourceSelector *ResourceSelector `protobuf:"bytes,1,opt,name=ResourceSelector,proto3" json:"ResourceSelector,omitempty"` -} - -func (x *ItemSnapshotterAppliesToResponse) Reset() { - *x = ItemSnapshotterAppliesToResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ItemSnapshotter_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ItemSnapshotterAppliesToResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ItemSnapshotterAppliesToResponse) ProtoMessage() {} - -func (x *ItemSnapshotterAppliesToResponse) ProtoReflect() protoreflect.Message { - mi := &file_ItemSnapshotter_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ItemSnapshotterAppliesToResponse.ProtoReflect.Descriptor instead. -func (*ItemSnapshotterAppliesToResponse) Descriptor() ([]byte, []int) { - return file_ItemSnapshotter_proto_rawDescGZIP(), []int{1} -} - -func (x *ItemSnapshotterAppliesToResponse) GetResourceSelector() *ResourceSelector { - if x != nil { - return x.ResourceSelector - } - return nil -} - -type AlsoHandlesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Plugin string `protobuf:"bytes,1,opt,name=plugin,proto3" 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 (x *AlsoHandlesRequest) Reset() { - *x = AlsoHandlesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ItemSnapshotter_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AlsoHandlesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AlsoHandlesRequest) ProtoMessage() {} - -func (x *AlsoHandlesRequest) ProtoReflect() protoreflect.Message { - mi := &file_ItemSnapshotter_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AlsoHandlesRequest.ProtoReflect.Descriptor instead. -func (*AlsoHandlesRequest) Descriptor() ([]byte, []int) { - return file_ItemSnapshotter_proto_rawDescGZIP(), []int{2} -} - -func (x *AlsoHandlesRequest) GetPlugin() string { - if x != nil { - return x.Plugin - } - return "" -} - -func (x *AlsoHandlesRequest) GetItem() []byte { - if x != nil { - return x.Item - } - return nil -} - -func (x *AlsoHandlesRequest) GetBackup() []byte { - if x != nil { - return x.Backup - } - return nil -} - -type AlsoHandlesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - HandledItems []*ResourceIdentifier `protobuf:"bytes,1,rep,name=handledItems,proto3" json:"handledItems,omitempty"` -} - -func (x *AlsoHandlesResponse) Reset() { - *x = AlsoHandlesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ItemSnapshotter_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AlsoHandlesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AlsoHandlesResponse) ProtoMessage() {} - -func (x *AlsoHandlesResponse) ProtoReflect() protoreflect.Message { - mi := &file_ItemSnapshotter_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use AlsoHandlesResponse.ProtoReflect.Descriptor instead. -func (*AlsoHandlesResponse) Descriptor() ([]byte, []int) { - return file_ItemSnapshotter_proto_rawDescGZIP(), []int{3} -} - -func (x *AlsoHandlesResponse) GetHandledItems() []*ResourceIdentifier { - if x != nil { - return x.HandledItems - } - return nil -} - -type SnapshotItemRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Plugin string `protobuf:"bytes,1,opt,name=plugin,proto3" json:"plugin,omitempty"` - Item []byte `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` - Params map[string]string `protobuf:"bytes,3,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Backup []byte `protobuf:"bytes,4,opt,name=backup,proto3" json:"backup,omitempty"` -} - -func (x *SnapshotItemRequest) Reset() { - *x = SnapshotItemRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ItemSnapshotter_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SnapshotItemRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SnapshotItemRequest) ProtoMessage() {} - -func (x *SnapshotItemRequest) ProtoReflect() protoreflect.Message { - mi := &file_ItemSnapshotter_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SnapshotItemRequest.ProtoReflect.Descriptor instead. -func (*SnapshotItemRequest) Descriptor() ([]byte, []int) { - return file_ItemSnapshotter_proto_rawDescGZIP(), []int{4} -} - -func (x *SnapshotItemRequest) GetPlugin() string { - if x != nil { - return x.Plugin - } - return "" -} - -func (x *SnapshotItemRequest) GetItem() []byte { - if x != nil { - return x.Item - } - return nil -} - -func (x *SnapshotItemRequest) GetParams() map[string]string { - if x != nil { - return x.Params - } - return nil -} - -func (x *SnapshotItemRequest) GetBackup() []byte { - if x != nil { - return x.Backup - } - return nil -} - -type SnapshotItemResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Item []byte `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` - SnapshotID string `protobuf:"bytes,2,opt,name=snapshotID,proto3" json:"snapshotID,omitempty"` - SnapshotMetadata map[string]string `protobuf:"bytes,3,rep,name=snapshotMetadata,proto3" json:"snapshotMetadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - AdditionalItems []*ResourceIdentifier `protobuf:"bytes,4,rep,name=additionalItems,proto3" json:"additionalItems,omitempty"` - HandledItems []*ResourceIdentifier `protobuf:"bytes,5,rep,name=handledItems,proto3" json:"handledItems,omitempty"` -} - -func (x *SnapshotItemResponse) Reset() { - *x = SnapshotItemResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ItemSnapshotter_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SnapshotItemResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SnapshotItemResponse) ProtoMessage() {} - -func (x *SnapshotItemResponse) ProtoReflect() protoreflect.Message { - mi := &file_ItemSnapshotter_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SnapshotItemResponse.ProtoReflect.Descriptor instead. -func (*SnapshotItemResponse) Descriptor() ([]byte, []int) { - return file_ItemSnapshotter_proto_rawDescGZIP(), []int{5} -} - -func (x *SnapshotItemResponse) GetItem() []byte { - if x != nil { - return x.Item - } - return nil -} - -func (x *SnapshotItemResponse) GetSnapshotID() string { - if x != nil { - return x.SnapshotID - } - return "" -} - -func (x *SnapshotItemResponse) GetSnapshotMetadata() map[string]string { - if x != nil { - return x.SnapshotMetadata - } - return nil -} - -func (x *SnapshotItemResponse) GetAdditionalItems() []*ResourceIdentifier { - if x != nil { - return x.AdditionalItems - } - return nil -} - -func (x *SnapshotItemResponse) GetHandledItems() []*ResourceIdentifier { - if x != nil { - return x.HandledItems - } - return nil -} - -type ProgressRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Plugin string `protobuf:"bytes,1,opt,name=plugin,proto3" json:"plugin,omitempty"` - ItemID *ResourceIdentifier `protobuf:"bytes,2,opt,name=itemID,proto3" json:"itemID,omitempty"` - SnapshotID string `protobuf:"bytes,3,opt,name=snapshotID,proto3" json:"snapshotID,omitempty"` - Backup []byte `protobuf:"bytes,4,opt,name=backup,proto3" json:"backup,omitempty"` -} - -func (x *ProgressRequest) Reset() { - *x = ProgressRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ItemSnapshotter_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProgressRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProgressRequest) ProtoMessage() {} - -func (x *ProgressRequest) ProtoReflect() protoreflect.Message { - mi := &file_ItemSnapshotter_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ProgressRequest.ProtoReflect.Descriptor instead. -func (*ProgressRequest) Descriptor() ([]byte, []int) { - return file_ItemSnapshotter_proto_rawDescGZIP(), []int{6} -} - -func (x *ProgressRequest) GetPlugin() string { - if x != nil { - return x.Plugin - } - return "" -} - -func (x *ProgressRequest) GetItemID() *ResourceIdentifier { - if x != nil { - return x.ItemID - } - return nil -} - -func (x *ProgressRequest) GetSnapshotID() string { - if x != nil { - return x.SnapshotID - } - return "" -} - -func (x *ProgressRequest) GetBackup() []byte { - if x != nil { - return x.Backup - } - return nil -} - -type ProgressResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Phase string `protobuf:"bytes,1,opt,name=phase,proto3" json:"phase,omitempty"` - ItemsCompleted int64 `protobuf:"varint,2,opt,name=itemsCompleted,proto3" json:"itemsCompleted,omitempty"` - ItemsToComplete int64 `protobuf:"varint,3,opt,name=itemsToComplete,proto3" json:"itemsToComplete,omitempty"` - Started int64 `protobuf:"varint,4,opt,name=started,proto3" json:"started,omitempty"` - StartedNano int64 `protobuf:"varint,5,opt,name=startedNano,proto3" json:"startedNano,omitempty"` - Updated int64 `protobuf:"varint,6,opt,name=updated,proto3" json:"updated,omitempty"` - UpdatedNano int64 `protobuf:"varint,7,opt,name=updatedNano,proto3" json:"updatedNano,omitempty"` - Err string `protobuf:"bytes,8,opt,name=err,proto3" json:"err,omitempty"` -} - -func (x *ProgressResponse) Reset() { - *x = ProgressResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ItemSnapshotter_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ProgressResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ProgressResponse) ProtoMessage() {} - -func (x *ProgressResponse) ProtoReflect() protoreflect.Message { - mi := &file_ItemSnapshotter_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ProgressResponse.ProtoReflect.Descriptor instead. -func (*ProgressResponse) Descriptor() ([]byte, []int) { - return file_ItemSnapshotter_proto_rawDescGZIP(), []int{7} -} - -func (x *ProgressResponse) GetPhase() string { - if x != nil { - return x.Phase - } - return "" -} - -func (x *ProgressResponse) GetItemsCompleted() int64 { - if x != nil { - return x.ItemsCompleted - } - return 0 -} - -func (x *ProgressResponse) GetItemsToComplete() int64 { - if x != nil { - return x.ItemsToComplete - } - return 0 -} - -func (x *ProgressResponse) GetStarted() int64 { - if x != nil { - return x.Started - } - return 0 -} - -func (x *ProgressResponse) GetStartedNano() int64 { - if x != nil { - return x.StartedNano - } - return 0 -} - -func (x *ProgressResponse) GetUpdated() int64 { - if x != nil { - return x.Updated - } - return 0 -} - -func (x *ProgressResponse) GetUpdatedNano() int64 { - if x != nil { - return x.UpdatedNano - } - return 0 -} - -func (x *ProgressResponse) GetErr() string { - if x != nil { - return x.Err - } - return "" -} - -type DeleteItemSnapshotRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Plugin string `protobuf:"bytes,1,opt,name=plugin,proto3" json:"plugin,omitempty"` - SnapshotID string `protobuf:"bytes,2,opt,name=snapshotID,proto3" json:"snapshotID,omitempty"` - ItemFromBackup []byte `protobuf:"bytes,3,opt,name=itemFromBackup,proto3" json:"itemFromBackup,omitempty"` - Metadata map[string]string `protobuf:"bytes,4,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Params map[string]string `protobuf:"bytes,5,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *DeleteItemSnapshotRequest) Reset() { - *x = DeleteItemSnapshotRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ItemSnapshotter_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteItemSnapshotRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteItemSnapshotRequest) ProtoMessage() {} - -func (x *DeleteItemSnapshotRequest) ProtoReflect() protoreflect.Message { - mi := &file_ItemSnapshotter_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteItemSnapshotRequest.ProtoReflect.Descriptor instead. -func (*DeleteItemSnapshotRequest) Descriptor() ([]byte, []int) { - return file_ItemSnapshotter_proto_rawDescGZIP(), []int{8} -} - -func (x *DeleteItemSnapshotRequest) GetPlugin() string { - if x != nil { - return x.Plugin - } - return "" -} - -func (x *DeleteItemSnapshotRequest) GetSnapshotID() string { - if x != nil { - return x.SnapshotID - } - return "" -} - -func (x *DeleteItemSnapshotRequest) GetItemFromBackup() []byte { - if x != nil { - return x.ItemFromBackup - } - return nil -} - -func (x *DeleteItemSnapshotRequest) GetMetadata() map[string]string { - if x != nil { - return x.Metadata - } - return nil -} - -func (x *DeleteItemSnapshotRequest) GetParams() map[string]string { - if x != nil { - return x.Params - } - return nil -} - -type CreateItemFromSnapshotRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Plugin string `protobuf:"bytes,1,opt,name=plugin,proto3" json:"plugin,omitempty"` - Item []byte `protobuf:"bytes,2,opt,name=item,proto3" json:"item,omitempty"` - SnapshotID string `protobuf:"bytes,3,opt,name=snapshotID,proto3" json:"snapshotID,omitempty"` - ItemFromBackup []byte `protobuf:"bytes,4,opt,name=itemFromBackup,proto3" json:"itemFromBackup,omitempty"` - SnapshotMetadata map[string]string `protobuf:"bytes,5,rep,name=snapshotMetadata,proto3" json:"snapshotMetadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Params map[string]string `protobuf:"bytes,6,rep,name=params,proto3" json:"params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - Restore []byte `protobuf:"bytes,7,opt,name=restore,proto3" json:"restore,omitempty"` -} - -func (x *CreateItemFromSnapshotRequest) Reset() { - *x = CreateItemFromSnapshotRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ItemSnapshotter_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateItemFromSnapshotRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateItemFromSnapshotRequest) ProtoMessage() {} - -func (x *CreateItemFromSnapshotRequest) ProtoReflect() protoreflect.Message { - mi := &file_ItemSnapshotter_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateItemFromSnapshotRequest.ProtoReflect.Descriptor instead. -func (*CreateItemFromSnapshotRequest) Descriptor() ([]byte, []int) { - return file_ItemSnapshotter_proto_rawDescGZIP(), []int{9} -} - -func (x *CreateItemFromSnapshotRequest) GetPlugin() string { - if x != nil { - return x.Plugin - } - return "" -} - -func (x *CreateItemFromSnapshotRequest) GetItem() []byte { - if x != nil { - return x.Item - } - return nil -} - -func (x *CreateItemFromSnapshotRequest) GetSnapshotID() string { - if x != nil { - return x.SnapshotID - } - return "" -} - -func (x *CreateItemFromSnapshotRequest) GetItemFromBackup() []byte { - if x != nil { - return x.ItemFromBackup - } - return nil -} - -func (x *CreateItemFromSnapshotRequest) GetSnapshotMetadata() map[string]string { - if x != nil { - return x.SnapshotMetadata - } - return nil -} - -func (x *CreateItemFromSnapshotRequest) GetParams() map[string]string { - if x != nil { - return x.Params - } - return nil -} - -func (x *CreateItemFromSnapshotRequest) GetRestore() []byte { - if x != nil { - return x.Restore - } - return nil -} - -type CreateItemFromSnapshotResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Item []byte `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` - AdditionalItems []*ResourceIdentifier `protobuf:"bytes,2,rep,name=additionalItems,proto3" json:"additionalItems,omitempty"` - SkipRestore bool `protobuf:"varint,3,opt,name=skipRestore,proto3" json:"skipRestore,omitempty"` -} - -func (x *CreateItemFromSnapshotResponse) Reset() { - *x = CreateItemFromSnapshotResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ItemSnapshotter_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateItemFromSnapshotResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateItemFromSnapshotResponse) ProtoMessage() {} - -func (x *CreateItemFromSnapshotResponse) ProtoReflect() protoreflect.Message { - mi := &file_ItemSnapshotter_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateItemFromSnapshotResponse.ProtoReflect.Descriptor instead. -func (*CreateItemFromSnapshotResponse) Descriptor() ([]byte, []int) { - return file_ItemSnapshotter_proto_rawDescGZIP(), []int{10} -} - -func (x *CreateItemFromSnapshotResponse) GetItem() []byte { - if x != nil { - return x.Item - } - return nil -} - -func (x *CreateItemFromSnapshotResponse) GetAdditionalItems() []*ResourceIdentifier { - if x != nil { - return x.AdditionalItems - } - return nil -} - -func (x *CreateItemFromSnapshotResponse) GetSkipRestore() bool { - if x != nil { - return x.SkipRestore - } - return false -} - -type ItemSnapshotterInitRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Plugin string `protobuf:"bytes,1,opt,name=plugin,proto3" json:"plugin,omitempty"` - Config map[string]string `protobuf:"bytes,2,rep,name=config,proto3" json:"config,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *ItemSnapshotterInitRequest) Reset() { - *x = ItemSnapshotterInitRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ItemSnapshotter_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ItemSnapshotterInitRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ItemSnapshotterInitRequest) ProtoMessage() {} - -func (x *ItemSnapshotterInitRequest) ProtoReflect() protoreflect.Message { - mi := &file_ItemSnapshotter_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ItemSnapshotterInitRequest.ProtoReflect.Descriptor instead. -func (*ItemSnapshotterInitRequest) Descriptor() ([]byte, []int) { - return file_ItemSnapshotter_proto_rawDescGZIP(), []int{11} -} - -func (x *ItemSnapshotterInitRequest) GetPlugin() string { - if x != nil { - return x.Plugin - } - return "" -} - -func (x *ItemSnapshotterInitRequest) GetConfig() map[string]string { - if x != nil { - return x.Config - } - return nil -} - -var File_ItemSnapshotter_proto protoreflect.FileDescriptor - -var file_ItemSnapshotter_proto_rawDesc = []byte{ - 0x0a, 0x15, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, - 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x1a, 0x0c, 0x53, 0x68, 0x61, 0x72, 0x65, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x39, 0x0a, 0x1f, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x74, 0x65, 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x54, 0x6f, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x22, 0x6b, 0x0a, 0x20, 0x49, - 0x74, 0x65, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x41, 0x70, - 0x70, 0x6c, 0x69, 0x65, 0x73, 0x54, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x47, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x53, 0x65, - 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x10, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, - 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x22, 0x58, 0x0a, 0x12, 0x41, 0x6c, 0x73, 0x6f, - 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, - 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x61, - 0x63, 0x6b, 0x75, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x62, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x22, 0x58, 0x0a, 0x13, 0x41, 0x6c, 0x73, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0c, 0x68, 0x61, 0x6e, - 0x64, 0x6c, 0x65, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x0c, - 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x22, 0xd8, 0x01, 0x0a, - 0x13, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, - 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, - 0x12, 0x42, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x2a, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x70, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x62, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x1a, 0x39, 0x0a, 0x0b, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xfe, 0x02, 0x0a, 0x14, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, - 0x69, 0x74, 0x65, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, - 0x6f, 0x74, 0x49, 0x44, 0x12, 0x61, 0x0a, 0x10, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x35, - 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x47, 0x0a, 0x0f, 0x61, 0x64, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, - 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, - 0x0f, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x74, 0x65, 0x6d, 0x73, - 0x12, 0x41, 0x0a, 0x0c, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x73, - 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x66, 0x69, 0x65, 0x72, 0x52, 0x0c, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x64, 0x49, 0x74, - 0x65, 0x6d, 0x73, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x98, 0x01, 0x0a, 0x0f, 0x50, 0x72, 0x6f, - 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x12, 0x35, 0x0a, 0x06, 0x69, 0x74, 0x65, 0x6d, 0x49, 0x44, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, - 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, - 0x69, 0x65, 0x72, 0x52, 0x06, 0x69, 0x74, 0x65, 0x6d, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x73, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x49, 0x44, 0x12, 0x16, 0x0a, 0x06, 0x62, - 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x62, 0x61, 0x63, - 0x6b, 0x75, 0x70, 0x22, 0x84, 0x02, 0x0a, 0x10, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x61, 0x73, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x61, 0x73, 0x65, 0x12, 0x26, - 0x0a, 0x0e, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x43, 0x6f, 0x6d, - 0x70, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x54, - 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0f, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x54, 0x6f, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, - 0x12, 0x18, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x74, - 0x61, 0x72, 0x74, 0x65, 0x64, 0x4e, 0x61, 0x6e, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0b, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x18, 0x0a, 0x07, - 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x75, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x4e, 0x61, 0x6e, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x64, 0x4e, 0x61, 0x6e, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x72, 0x72, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x65, 0x72, 0x72, 0x22, 0x8d, 0x03, 0x0a, 0x19, 0x44, - 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x67, - 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, - 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x49, 0x44, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x49, 0x44, - 0x12, 0x26, 0x0a, 0x0e, 0x69, 0x74, 0x65, 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x42, 0x61, 0x63, 0x6b, - 0x75, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0e, 0x69, 0x74, 0x65, 0x6d, 0x46, 0x72, - 0x6f, 0x6d, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x12, 0x4e, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x74, 0x65, - 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, - 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x48, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x1a, 0x3b, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, - 0x39, 0x0a, 0x0b, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xe7, 0x03, 0x0a, 0x1d, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x53, 0x6e, 0x61, - 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, - 0x75, 0x67, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x69, 0x74, 0x65, 0x6d, - 0x46, 0x72, 0x6f, 0x6d, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, - 0x52, 0x0e, 0x69, 0x74, 0x65, 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x42, 0x61, 0x63, 0x6b, 0x75, 0x70, - 0x12, 0x6a, 0x0a, 0x10, 0x73, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x74, 0x65, - 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x4c, 0x0a, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, - 0x74, 0x65, 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, - 0x73, 0x74, 0x6f, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x72, 0x65, 0x73, - 0x74, 0x6f, 0x72, 0x65, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x39, 0x0a, 0x0b, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0x9f, 0x01, 0x0a, 0x1e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, - 0x74, 0x65, 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x69, 0x74, 0x65, 0x6d, 0x12, 0x47, 0x0a, 0x0f, 0x61, - 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, - 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, - 0x69, 0x65, 0x72, 0x52, 0x0f, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x49, - 0x74, 0x65, 0x6d, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x73, 0x6b, 0x69, 0x70, 0x52, 0x65, 0x73, 0x74, - 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x73, 0x6b, 0x69, 0x70, 0x52, - 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0xba, 0x01, 0x0a, 0x1a, 0x49, 0x74, 0x65, 0x6d, 0x53, - 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x12, 0x49, 0x0a, - 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x1a, 0x39, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x32, 0xd5, 0x04, 0x0a, 0x0f, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x04, 0x49, 0x6e, 0x69, 0x74, 0x12, - 0x25, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x49, 0x74, 0x65, 0x6d, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x49, 0x6e, 0x69, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x64, 0x0a, 0x09, 0x41, 0x70, 0x70, 0x6c, - 0x69, 0x65, 0x73, 0x54, 0x6f, 0x12, 0x2a, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, - 0x72, 0x41, 0x70, 0x70, 0x6c, 0x69, 0x65, 0x73, 0x54, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x49, 0x74, - 0x65, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x74, 0x65, 0x72, 0x41, 0x70, 0x70, - 0x6c, 0x69, 0x65, 0x73, 0x54, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4c, - 0x0a, 0x0b, 0x41, 0x6c, 0x73, 0x6f, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x12, 0x1d, 0x2e, - 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x41, 0x6c, 0x73, 0x6f, 0x48, 0x61, - 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x41, 0x6c, 0x73, 0x6f, 0x48, 0x61, 0x6e, - 0x64, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4f, 0x0a, 0x0c, - 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1e, 0x2e, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, - 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, - 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x43, 0x0a, - 0x08, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1a, 0x2e, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x2e, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x48, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x53, 0x6e, 0x61, 0x70, - 0x73, 0x68, 0x6f, 0x74, 0x12, 0x24, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, - 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x6d, 0x0a, 0x16, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x53, 0x6e, - 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x12, 0x28, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x46, 0x72, 0x6f, - 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x73, 0x68, 0x6f, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x29, 0x2e, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2e, 0x43, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x46, 0x72, 0x6f, 0x6d, 0x53, 0x6e, 0x61, 0x70, 0x73, - 0x68, 0x6f, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x35, 0x5a, 0x33, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x6d, 0x77, 0x61, 0x72, 0x65, - 0x2d, 0x74, 0x61, 0x6e, 0x7a, 0x75, 0x2f, 0x76, 0x65, 0x6c, 0x65, 0x72, 0x6f, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, - 0x65, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_ItemSnapshotter_proto_rawDescOnce sync.Once - file_ItemSnapshotter_proto_rawDescData = file_ItemSnapshotter_proto_rawDesc -) - -func file_ItemSnapshotter_proto_rawDescGZIP() []byte { - file_ItemSnapshotter_proto_rawDescOnce.Do(func() { - file_ItemSnapshotter_proto_rawDescData = protoimpl.X.CompressGZIP(file_ItemSnapshotter_proto_rawDescData) - }) - return file_ItemSnapshotter_proto_rawDescData -} - -var file_ItemSnapshotter_proto_msgTypes = make([]protoimpl.MessageInfo, 19) -var file_ItemSnapshotter_proto_goTypes = []interface{}{ - (*ItemSnapshotterAppliesToRequest)(nil), // 0: generated.ItemSnapshotterAppliesToRequest - (*ItemSnapshotterAppliesToResponse)(nil), // 1: generated.ItemSnapshotterAppliesToResponse - (*AlsoHandlesRequest)(nil), // 2: generated.AlsoHandlesRequest - (*AlsoHandlesResponse)(nil), // 3: generated.AlsoHandlesResponse - (*SnapshotItemRequest)(nil), // 4: generated.SnapshotItemRequest - (*SnapshotItemResponse)(nil), // 5: generated.SnapshotItemResponse - (*ProgressRequest)(nil), // 6: generated.ProgressRequest - (*ProgressResponse)(nil), // 7: generated.ProgressResponse - (*DeleteItemSnapshotRequest)(nil), // 8: generated.DeleteItemSnapshotRequest - (*CreateItemFromSnapshotRequest)(nil), // 9: generated.CreateItemFromSnapshotRequest - (*CreateItemFromSnapshotResponse)(nil), // 10: generated.CreateItemFromSnapshotResponse - (*ItemSnapshotterInitRequest)(nil), // 11: generated.ItemSnapshotterInitRequest - nil, // 12: generated.SnapshotItemRequest.ParamsEntry - nil, // 13: generated.SnapshotItemResponse.SnapshotMetadataEntry - nil, // 14: generated.DeleteItemSnapshotRequest.MetadataEntry - nil, // 15: generated.DeleteItemSnapshotRequest.ParamsEntry - nil, // 16: generated.CreateItemFromSnapshotRequest.SnapshotMetadataEntry - nil, // 17: generated.CreateItemFromSnapshotRequest.ParamsEntry - nil, // 18: generated.ItemSnapshotterInitRequest.ConfigEntry - (*ResourceSelector)(nil), // 19: generated.ResourceSelector - (*ResourceIdentifier)(nil), // 20: generated.ResourceIdentifier - (*Empty)(nil), // 21: generated.Empty -} -var file_ItemSnapshotter_proto_depIdxs = []int32{ - 19, // 0: generated.ItemSnapshotterAppliesToResponse.ResourceSelector:type_name -> generated.ResourceSelector - 20, // 1: generated.AlsoHandlesResponse.handledItems:type_name -> generated.ResourceIdentifier - 12, // 2: generated.SnapshotItemRequest.params:type_name -> generated.SnapshotItemRequest.ParamsEntry - 13, // 3: generated.SnapshotItemResponse.snapshotMetadata:type_name -> generated.SnapshotItemResponse.SnapshotMetadataEntry - 20, // 4: generated.SnapshotItemResponse.additionalItems:type_name -> generated.ResourceIdentifier - 20, // 5: generated.SnapshotItemResponse.handledItems:type_name -> generated.ResourceIdentifier - 20, // 6: generated.ProgressRequest.itemID:type_name -> generated.ResourceIdentifier - 14, // 7: generated.DeleteItemSnapshotRequest.metadata:type_name -> generated.DeleteItemSnapshotRequest.MetadataEntry - 15, // 8: generated.DeleteItemSnapshotRequest.params:type_name -> generated.DeleteItemSnapshotRequest.ParamsEntry - 16, // 9: generated.CreateItemFromSnapshotRequest.snapshotMetadata:type_name -> generated.CreateItemFromSnapshotRequest.SnapshotMetadataEntry - 17, // 10: generated.CreateItemFromSnapshotRequest.params:type_name -> generated.CreateItemFromSnapshotRequest.ParamsEntry - 20, // 11: generated.CreateItemFromSnapshotResponse.additionalItems:type_name -> generated.ResourceIdentifier - 18, // 12: generated.ItemSnapshotterInitRequest.config:type_name -> generated.ItemSnapshotterInitRequest.ConfigEntry - 11, // 13: generated.ItemSnapshotter.Init:input_type -> generated.ItemSnapshotterInitRequest - 0, // 14: generated.ItemSnapshotter.AppliesTo:input_type -> generated.ItemSnapshotterAppliesToRequest - 2, // 15: generated.ItemSnapshotter.AlsoHandles:input_type -> generated.AlsoHandlesRequest - 4, // 16: generated.ItemSnapshotter.SnapshotItem:input_type -> generated.SnapshotItemRequest - 6, // 17: generated.ItemSnapshotter.Progress:input_type -> generated.ProgressRequest - 8, // 18: generated.ItemSnapshotter.DeleteSnapshot:input_type -> generated.DeleteItemSnapshotRequest - 9, // 19: generated.ItemSnapshotter.CreateItemFromSnapshot:input_type -> generated.CreateItemFromSnapshotRequest - 21, // 20: generated.ItemSnapshotter.Init:output_type -> generated.Empty - 1, // 21: generated.ItemSnapshotter.AppliesTo:output_type -> generated.ItemSnapshotterAppliesToResponse - 3, // 22: generated.ItemSnapshotter.AlsoHandles:output_type -> generated.AlsoHandlesResponse - 5, // 23: generated.ItemSnapshotter.SnapshotItem:output_type -> generated.SnapshotItemResponse - 7, // 24: generated.ItemSnapshotter.Progress:output_type -> generated.ProgressResponse - 21, // 25: generated.ItemSnapshotter.DeleteSnapshot:output_type -> generated.Empty - 10, // 26: generated.ItemSnapshotter.CreateItemFromSnapshot:output_type -> generated.CreateItemFromSnapshotResponse - 20, // [20:27] is the sub-list for method output_type - 13, // [13:20] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name -} - -func init() { file_ItemSnapshotter_proto_init() } -func file_ItemSnapshotter_proto_init() { - if File_ItemSnapshotter_proto != nil { - return - } - file_Shared_proto_init() - if !protoimpl.UnsafeEnabled { - file_ItemSnapshotter_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ItemSnapshotterAppliesToRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ItemSnapshotter_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ItemSnapshotterAppliesToResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ItemSnapshotter_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AlsoHandlesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ItemSnapshotter_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AlsoHandlesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ItemSnapshotter_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SnapshotItemRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ItemSnapshotter_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SnapshotItemResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ItemSnapshotter_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProgressRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ItemSnapshotter_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProgressResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ItemSnapshotter_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteItemSnapshotRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ItemSnapshotter_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateItemFromSnapshotRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ItemSnapshotter_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateItemFromSnapshotResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ItemSnapshotter_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ItemSnapshotterInitRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_ItemSnapshotter_proto_rawDesc, - NumEnums: 0, - NumMessages: 19, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_ItemSnapshotter_proto_goTypes, - DependencyIndexes: file_ItemSnapshotter_proto_depIdxs, - MessageInfos: file_ItemSnapshotter_proto_msgTypes, - }.Build() - File_ItemSnapshotter_proto = out.File - file_ItemSnapshotter_proto_rawDesc = nil - file_ItemSnapshotter_proto_goTypes = nil - file_ItemSnapshotter_proto_depIdxs = nil -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// 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.SupportPackageIsVersion6 - -// ItemSnapshotterClient is the client API for ItemSnapshotter service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type ItemSnapshotterClient interface { - Init(ctx context.Context, in *ItemSnapshotterInitRequest, opts ...grpc.CallOption) (*Empty, error) - AppliesTo(ctx context.Context, in *ItemSnapshotterAppliesToRequest, opts ...grpc.CallOption) (*ItemSnapshotterAppliesToResponse, error) - AlsoHandles(ctx context.Context, in *AlsoHandlesRequest, opts ...grpc.CallOption) (*AlsoHandlesResponse, error) - SnapshotItem(ctx context.Context, in *SnapshotItemRequest, opts ...grpc.CallOption) (*SnapshotItemResponse, error) - Progress(ctx context.Context, in *ProgressRequest, opts ...grpc.CallOption) (*ProgressResponse, error) - DeleteSnapshot(ctx context.Context, in *DeleteItemSnapshotRequest, opts ...grpc.CallOption) (*Empty, error) - CreateItemFromSnapshot(ctx context.Context, in *CreateItemFromSnapshotRequest, opts ...grpc.CallOption) (*CreateItemFromSnapshotResponse, error) -} - -type itemSnapshotterClient struct { - cc grpc.ClientConnInterface -} - -func NewItemSnapshotterClient(cc grpc.ClientConnInterface) ItemSnapshotterClient { - return &itemSnapshotterClient{cc} -} - -func (c *itemSnapshotterClient) Init(ctx context.Context, in *ItemSnapshotterInitRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/generated.ItemSnapshotter/Init", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *itemSnapshotterClient) AppliesTo(ctx context.Context, in *ItemSnapshotterAppliesToRequest, opts ...grpc.CallOption) (*ItemSnapshotterAppliesToResponse, error) { - out := new(ItemSnapshotterAppliesToResponse) - err := c.cc.Invoke(ctx, "/generated.ItemSnapshotter/AppliesTo", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *itemSnapshotterClient) AlsoHandles(ctx context.Context, in *AlsoHandlesRequest, opts ...grpc.CallOption) (*AlsoHandlesResponse, error) { - out := new(AlsoHandlesResponse) - err := c.cc.Invoke(ctx, "/generated.ItemSnapshotter/AlsoHandles", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *itemSnapshotterClient) SnapshotItem(ctx context.Context, in *SnapshotItemRequest, opts ...grpc.CallOption) (*SnapshotItemResponse, error) { - out := new(SnapshotItemResponse) - err := c.cc.Invoke(ctx, "/generated.ItemSnapshotter/SnapshotItem", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *itemSnapshotterClient) Progress(ctx context.Context, in *ProgressRequest, opts ...grpc.CallOption) (*ProgressResponse, error) { - out := new(ProgressResponse) - err := c.cc.Invoke(ctx, "/generated.ItemSnapshotter/Progress", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *itemSnapshotterClient) DeleteSnapshot(ctx context.Context, in *DeleteItemSnapshotRequest, opts ...grpc.CallOption) (*Empty, error) { - out := new(Empty) - err := c.cc.Invoke(ctx, "/generated.ItemSnapshotter/DeleteSnapshot", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *itemSnapshotterClient) CreateItemFromSnapshot(ctx context.Context, in *CreateItemFromSnapshotRequest, opts ...grpc.CallOption) (*CreateItemFromSnapshotResponse, error) { - out := new(CreateItemFromSnapshotResponse) - err := c.cc.Invoke(ctx, "/generated.ItemSnapshotter/CreateItemFromSnapshot", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ItemSnapshotterServer is the server API for ItemSnapshotter service. -type ItemSnapshotterServer interface { - Init(context.Context, *ItemSnapshotterInitRequest) (*Empty, error) - AppliesTo(context.Context, *ItemSnapshotterAppliesToRequest) (*ItemSnapshotterAppliesToResponse, error) - AlsoHandles(context.Context, *AlsoHandlesRequest) (*AlsoHandlesResponse, error) - SnapshotItem(context.Context, *SnapshotItemRequest) (*SnapshotItemResponse, error) - Progress(context.Context, *ProgressRequest) (*ProgressResponse, error) - DeleteSnapshot(context.Context, *DeleteItemSnapshotRequest) (*Empty, error) - CreateItemFromSnapshot(context.Context, *CreateItemFromSnapshotRequest) (*CreateItemFromSnapshotResponse, error) -} - -// UnimplementedItemSnapshotterServer can be embedded to have forward compatible implementations. -type UnimplementedItemSnapshotterServer struct { -} - -func (*UnimplementedItemSnapshotterServer) Init(context.Context, *ItemSnapshotterInitRequest) (*Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method Init not implemented") -} -func (*UnimplementedItemSnapshotterServer) AppliesTo(context.Context, *ItemSnapshotterAppliesToRequest) (*ItemSnapshotterAppliesToResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AppliesTo not implemented") -} -func (*UnimplementedItemSnapshotterServer) AlsoHandles(context.Context, *AlsoHandlesRequest) (*AlsoHandlesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method AlsoHandles not implemented") -} -func (*UnimplementedItemSnapshotterServer) SnapshotItem(context.Context, *SnapshotItemRequest) (*SnapshotItemResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SnapshotItem not implemented") -} -func (*UnimplementedItemSnapshotterServer) Progress(context.Context, *ProgressRequest) (*ProgressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Progress not implemented") -} -func (*UnimplementedItemSnapshotterServer) DeleteSnapshot(context.Context, *DeleteItemSnapshotRequest) (*Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteSnapshot not implemented") -} -func (*UnimplementedItemSnapshotterServer) CreateItemFromSnapshot(context.Context, *CreateItemFromSnapshotRequest) (*CreateItemFromSnapshotResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateItemFromSnapshot not implemented") -} - -func RegisterItemSnapshotterServer(s *grpc.Server, srv ItemSnapshotterServer) { - s.RegisterService(&_ItemSnapshotter_serviceDesc, srv) -} - -func _ItemSnapshotter_Init_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ItemSnapshotterInitRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ItemSnapshotterServer).Init(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/generated.ItemSnapshotter/Init", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ItemSnapshotterServer).Init(ctx, req.(*ItemSnapshotterInitRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ItemSnapshotter_AppliesTo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ItemSnapshotterAppliesToRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ItemSnapshotterServer).AppliesTo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/generated.ItemSnapshotter/AppliesTo", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ItemSnapshotterServer).AppliesTo(ctx, req.(*ItemSnapshotterAppliesToRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ItemSnapshotter_AlsoHandles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(AlsoHandlesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ItemSnapshotterServer).AlsoHandles(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/generated.ItemSnapshotter/AlsoHandles", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ItemSnapshotterServer).AlsoHandles(ctx, req.(*AlsoHandlesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ItemSnapshotter_SnapshotItem_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SnapshotItemRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ItemSnapshotterServer).SnapshotItem(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/generated.ItemSnapshotter/SnapshotItem", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ItemSnapshotterServer).SnapshotItem(ctx, req.(*SnapshotItemRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ItemSnapshotter_Progress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ProgressRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ItemSnapshotterServer).Progress(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/generated.ItemSnapshotter/Progress", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ItemSnapshotterServer).Progress(ctx, req.(*ProgressRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ItemSnapshotter_DeleteSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteItemSnapshotRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ItemSnapshotterServer).DeleteSnapshot(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/generated.ItemSnapshotter/DeleteSnapshot", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ItemSnapshotterServer).DeleteSnapshot(ctx, req.(*DeleteItemSnapshotRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _ItemSnapshotter_CreateItemFromSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateItemFromSnapshotRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ItemSnapshotterServer).CreateItemFromSnapshot(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/generated.ItemSnapshotter/CreateItemFromSnapshot", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ItemSnapshotterServer).CreateItemFromSnapshot(ctx, req.(*CreateItemFromSnapshotRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _ItemSnapshotter_serviceDesc = grpc.ServiceDesc{ - ServiceName: "generated.ItemSnapshotter", - HandlerType: (*ItemSnapshotterServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Init", - Handler: _ItemSnapshotter_Init_Handler, - }, - { - MethodName: "AppliesTo", - Handler: _ItemSnapshotter_AppliesTo_Handler, - }, - { - MethodName: "AlsoHandles", - Handler: _ItemSnapshotter_AlsoHandles_Handler, - }, - { - MethodName: "SnapshotItem", - Handler: _ItemSnapshotter_SnapshotItem_Handler, - }, - { - MethodName: "Progress", - Handler: _ItemSnapshotter_Progress_Handler, - }, - { - MethodName: "DeleteSnapshot", - Handler: _ItemSnapshotter_DeleteSnapshot_Handler, - }, - { - MethodName: "CreateItemFromSnapshot", - Handler: _ItemSnapshotter_CreateItemFromSnapshot_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "ItemSnapshotter.proto", -} diff --git a/pkg/plugin/mocks/manager.go b/pkg/plugin/mocks/manager.go index 25b6d95ae4..8cb3274742 100644 --- a/pkg/plugin/mocks/manager.go +++ b/pkg/plugin/mocks/manager.go @@ -4,8 +4,6 @@ package mocks import ( mock "github.com/stretchr/testify/mock" - item_snapshotterv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/item_snapshotter/v1" - restoreitemactionv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/restoreitemaction/v1" restoreitemactionv2 "github.com/vmware-tanzu/velero/pkg/plugin/velero/restoreitemaction/v2" @@ -167,52 +165,6 @@ func (_m *Manager) GetDeleteItemActions() ([]velero.DeleteItemAction, error) { return r0, r1 } -// GetItemSnapshotter provides a mock function with given fields: name -func (_m *Manager) GetItemSnapshotter(name string) (item_snapshotterv1.ItemSnapshotter, error) { - ret := _m.Called(name) - - var r0 item_snapshotterv1.ItemSnapshotter - if rf, ok := ret.Get(0).(func(string) item_snapshotterv1.ItemSnapshotter); ok { - r0 = rf(name) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(item_snapshotterv1.ItemSnapshotter) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(string) error); ok { - r1 = rf(name) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// GetItemSnapshotters provides a mock function with given fields: -func (_m *Manager) GetItemSnapshotters() ([]item_snapshotterv1.ItemSnapshotter, error) { - ret := _m.Called() - - var r0 []item_snapshotterv1.ItemSnapshotter - if rf, ok := ret.Get(0).(func() []item_snapshotterv1.ItemSnapshotter); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]item_snapshotterv1.ItemSnapshotter) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - // GetObjectStore provides a mock function with given fields: name func (_m *Manager) GetObjectStore(name string) (velero.ObjectStore, error) { ret := _m.Called(name) diff --git a/pkg/plugin/proto/ItemSnapshotter.proto b/pkg/plugin/proto/ItemSnapshotter.proto deleted file mode 100644 index a5f6455860..0000000000 --- a/pkg/plugin/proto/ItemSnapshotter.proto +++ /dev/null @@ -1,95 +0,0 @@ -syntax = "proto3"; -package generated; -option go_package = "github.com/vmware-tanzu/velero/pkg/plugin/generated"; - -import "Shared.proto"; - -message ItemSnapshotterAppliesToRequest { - string plugin = 1; -} - -message ItemSnapshotterAppliesToResponse { - ResourceSelector ResourceSelector = 1; -} - -message AlsoHandlesRequest { - string plugin = 1; - bytes item = 2; - bytes backup = 3; -} - -message AlsoHandlesResponse { - repeated ResourceIdentifier handledItems = 1; -} - -message SnapshotItemRequest { - string plugin = 1; - bytes item = 2; - map params = 3; - bytes backup = 4; -} - -message SnapshotItemResponse { - bytes item = 1; - string snapshotID = 2; - map snapshotMetadata = 3; - repeated ResourceIdentifier additionalItems = 4; - repeated ResourceIdentifier handledItems = 5; -} - -message ProgressRequest { - string plugin = 1; - ResourceIdentifier itemID = 2; - string snapshotID = 3; - bytes backup = 4; -} - -message ProgressResponse { - string phase = 1; - int64 itemsCompleted = 2; - int64 itemsToComplete = 3; - int64 started = 4; - int64 startedNano = 5; - int64 updated = 6; - int64 updatedNano = 7; - string err = 8; -} - -message DeleteItemSnapshotRequest { - string plugin = 1; - string snapshotID = 2; - bytes itemFromBackup = 3; - map metadata = 4; - map params = 5; -} - -message CreateItemFromSnapshotRequest { - string plugin = 1; - bytes item = 2; - string snapshotID = 3; - bytes itemFromBackup = 4; - map snapshotMetadata = 5; - map params = 6; - bytes restore = 7; -} - -message CreateItemFromSnapshotResponse { - bytes item = 1; - repeated ResourceIdentifier additionalItems = 2; - bool skipRestore = 3; -} - -message ItemSnapshotterInitRequest { - string plugin = 1; - map config = 2; -} - -service ItemSnapshotter { - rpc Init(ItemSnapshotterInitRequest) returns (Empty); - rpc AppliesTo(ItemSnapshotterAppliesToRequest) returns (ItemSnapshotterAppliesToResponse); - rpc AlsoHandles(AlsoHandlesRequest) returns (AlsoHandlesResponse); - rpc SnapshotItem(SnapshotItemRequest) returns (SnapshotItemResponse); - rpc Progress(ProgressRequest) returns (ProgressResponse); - rpc DeleteSnapshot(DeleteItemSnapshotRequest) returns (Empty); - rpc CreateItemFromSnapshot(CreateItemFromSnapshotRequest) returns (CreateItemFromSnapshotResponse); -} diff --git a/pkg/plugin/velero/item_snapshotter/v1/item_snapshotter.go b/pkg/plugin/velero/item_snapshotter/v1/item_snapshotter.go deleted file mode 100644 index e43760b8e8..0000000000 --- a/pkg/plugin/velero/item_snapshotter/v1/item_snapshotter.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -Copyright the Velero contributors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "context" - "fmt" - "time" - - "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 { - // Item is the item that will be snapshotted - Item runtime.Unstructured - // Backup is the representation of the backup resource being processed by Velero. - Backup *api.Backup -} - -type SnapshotItemInput struct { - // Item is the item to snapshot - Item runtime.Unstructured - // Params are parameters to the snapshot - Params map[string]string - // Backup is the representation of the backup resource being processed by Velero. - Backup *api.Backup -} - -type SnapshotItemOutput struct { - // UpdatedItem is the Item that should be included in the backup. It can optionally be modified during the Snapshot - UpdatedItem runtime.Unstructured - // SnapshotID identifies the snapshot that was taken - SnapshotID string - // SnapshotMetadata is information in addition to the SnapshotID that the - // plugin wants to store in the backup. SnapshotMetadata will be passed - // back in for DeleteSnapshot and CreateItemFromSnapshot - SnapshotMetadata map[string]string - // AdditionalItems are resources that need to be included in the backup to support this snapshhot - AdditionalItems []velero.ResourceIdentifier - // Items that were handled by this snapshot that should be excluded from the backup - HandledItems []velero.ResourceIdentifier -} - -// ProgressInput contains the input parameters for the ItemSnapshotter's Progress function. -type ProgressInput struct { - // ItemID is the id of item that was stored in the backup - ItemID velero.ResourceIdentifier - // SnapshotID is the snapshot ID returned by ItemSnapshotter - SnapshotID string - // Backup is the representation of the backup resource being processed by Velero. - Backup *api.Backup -} - -// SnapshotPhase is the lifecycle phase of a Velero item snapshot. -type SnapshotPhase string - -const ( - // SnapshotPhaseInProgress means the snapshot of the item has been taken and the point-in-time has been preserved, - // but the snapshot is not ready for use yet - SnapshotPhaseInProgress = SnapshotPhase("InProgress") - - // SnapshotPhaseCompleted means the item snapshot was successfully created and can be restored from - SnapshotPhaseCompleted = SnapshotPhase("Completed") - - // SnapshotPhaseFailed means the item snapshot was unable to be completed - SnapshotPhaseFailed = SnapshotPhase("Failed") -) - -func SnapshotPhaseFromString(phase string) (SnapshotPhase, error) { - switch phase { - case string(SnapshotPhaseInProgress): - return SnapshotPhaseInProgress, nil - case string(SnapshotPhaseCompleted): - return SnapshotPhaseCompleted, nil - case string(SnapshotPhaseFailed): - return SnapshotPhaseFailed, nil - default: - return SnapshotPhase(""), fmt.Errorf("%s is not a valid SnapshotPhase", phase) - } -} - -type ProgressOutput struct { - // Phase of the snapshot. If the phase is SnapshotPhaseFailed, the error will be in the Err string - Phase SnapshotPhase - // Err is a message about the error(s) that occurred during the processing of the snapshot - Err string - // ItemsCompleted is the number of items that have been completed in processing of the snapshot - // This is simply to show progress, when Phase goes to SnapshotPhaseCompleted ItemsCompleted and ItemsToComplete - // should be the same. This could be blocks to copy, files to copy, or anything else. - ItemsCompleted int64 - // ItemsToComplete is the number of items that need to be completed - ItemsToComplete int64 - // Started indicates when processing on the snapshot began (usually the time the snapshot was taken) - Started time.Time - // Updated indicates the time the status was last updated. Time 0 (time.Unix(0, 0)) is returned if unknown. - Updated time.Time -} - -type DeleteSnapshotInput struct { - // SnapshotID is the snapshot to delete - SnapshotID string - // ItemFromBackup is the resource that was included in the backup - ItemFromBackup runtime.Unstructured - // SnapshotMetadata is the metadata that was returned when the snapshot was originally taken - SnapshotMetadata map[string]string - // Params are parameters to the deletion - Params map[string]string -} - -type CreateItemInput struct { - // The snapshotted item at this stage of the restore (RestoreItemActions may - // have modified the item prior to CreateItemFromSnapshot being called) - SnapshottedItem runtime.Unstructured - // SnapshotID is the snapshot to create the item from - SnapshotID string - // ItemFromBackup is the snapshotted item that was stored in the backup - ItemFromBackup runtime.Unstructured - // SnapshotMetadata is the metadata that was returned when the snapshot was originally taken - SnapshotMetadata map[string]string - // Params are parameters to the deletion - Params map[string]string - // Restore is the representation of the restore resource being processed by Velero. - Restore *api.Restore -} - -type CreateItemOutput struct { - // UpdatedItem is the item being restored mutated by ItemAction. - UpdatedItem runtime.Unstructured - - // AdditionalItems is a list of additional related items that should - // be restored. - AdditionalItems []velero.ResourceIdentifier - - // SkipRestore tells velero to stop executing further actions - // on this item, and skip the restore step. When this field's - // value is true, AdditionalItems will be ignored. - SkipRestore bool -} - -// ItemSnapshotter handles snapshots on an individual item being backed up. -type ItemSnapshotter interface { - - // Init prepares the ItemSnapshotter for usage using the provided map of - // configuration key-value pairs. It returns an error if the ItemSnapshotter - // cannot be initialized from the provided config. - Init(config map[string]string) error - - // AppliesTo returns information about which resources this action should be invoked for. - // An ItemSnapshotter's SnapshotItem method will only be invoked on items that match the returned - // selector. A zero-valued ResourceSelector matches all resources. - AppliesTo() (velero.ResourceSelector, error) - - // AlsoHandles is called for each item this ItemSnapshotter should handle and returns any items - // which will be handled by this plugin when snapshotting the item. These items will be excluded from the - // items being backed up. AlsoHandles will be called before SnapshotItem is called. For example, a database may expose - // a database resource that can be snapshotted. If the database uses a PVC that will be snapshotted/backed up as - // part of the database snapshot, that PVC should be returned when AlsoHandles is invoked. This is different from - // AdditionalItems (returned in SnapshotItemOutput and CreateItemOutput) which are specifying additional resources - // that Velero should store in the backup or create. - AlsoHandles(input *AlsoHandlesInput) ([]velero.ResourceIdentifier, error) - - // SnapshotItem causes the ItemSnapshotter to snapshot the specified item. It may also - // 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. - // A caller can pass a context that includes a timeout. If the time to take the snapshot exceeds the - // time in the context, the plugin may abort the snapshot. The context timeout does not apply to upload - // time that occurs after SnapshotItem returns - SnapshotItem(ctx context.Context, input *SnapshotItemInput) (*SnapshotItemOutput, error) - - // Progress will return the progress of a snapshot that is being uploaded - Progress(input *ProgressInput) (*ProgressOutput, error) - - // DeleteSnapshot removes a snapshot - DeleteSnapshot(ctx context.Context, input *DeleteSnapshotInput) error - - // CreateItemFromSnapshot creates a new item from the snapshot - CreateItemFromSnapshot(ctx context.Context, input *CreateItemInput) (*CreateItemOutput, error) -} diff --git a/pkg/plugin/velero/item_snapshotter/v1/mocks/item_snapshotter.go b/pkg/plugin/velero/item_snapshotter/v1/mocks/item_snapshotter.go deleted file mode 100644 index 5d2b76c1df..0000000000 --- a/pkg/plugin/velero/item_snapshotter/v1/mocks/item_snapshotter.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by mockery v0.0.0-dev. DO NOT EDIT. - -package mocks - -import ( - context "context" - mock "github.com/stretchr/testify/mock" - - 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 -type ItemSnapshotter struct { - mock.Mock -} - -// AlsoHandles provides a mock function with given fields: input -func (_m *ItemSnapshotter) AlsoHandles(input *v1.AlsoHandlesInput) ([]velero.ResourceIdentifier, error) { - ret := _m.Called(input) - - var r0 []velero.ResourceIdentifier - if rf, ok := ret.Get(0).(func(*v1.AlsoHandlesInput) []velero.ResourceIdentifier); ok { - r0 = rf(input) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]velero.ResourceIdentifier) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(*v1.AlsoHandlesInput) error); ok { - r1 = rf(input) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// AppliesTo provides a mock function with given fields: -func (_m *ItemSnapshotter) AppliesTo() (velero.ResourceSelector, error) { - ret := _m.Called() - - var r0 velero.ResourceSelector - if rf, ok := ret.Get(0).(func() velero.ResourceSelector); ok { - r0 = rf() - } else { - r0 = ret.Get(0).(velero.ResourceSelector) - } - - var r1 error - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// CreateItemFromSnapshot provides a mock function with given fields: ctx, input -func (_m *ItemSnapshotter) CreateItemFromSnapshot(ctx context.Context, input *v1.CreateItemInput) (*v1.CreateItemOutput, error) { - ret := _m.Called(ctx, input) - - var r0 *v1.CreateItemOutput - if rf, ok := ret.Get(0).(func(context.Context, *v1.CreateItemInput) *v1.CreateItemOutput); ok { - r0 = rf(ctx, input) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.CreateItemOutput) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, *v1.CreateItemInput) error); ok { - r1 = rf(ctx, input) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// DeleteSnapshot provides a mock function with given fields: ctx, input -func (_m *ItemSnapshotter) DeleteSnapshot(ctx context.Context, input *v1.DeleteSnapshotInput) error { - ret := _m.Called(ctx, input) - - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *v1.DeleteSnapshotInput) error); ok { - r0 = rf(ctx, input) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Init provides a mock function with given fields: config -func (_m *ItemSnapshotter) Init(config map[string]string) error { - ret := _m.Called(config) - - var r0 error - if rf, ok := ret.Get(0).(func(map[string]string) error); ok { - r0 = rf(config) - } else { - r0 = ret.Error(0) - } - - return r0 -} - -// Progress provides a mock function with given fields: input -func (_m *ItemSnapshotter) Progress(input *v1.ProgressInput) (*v1.ProgressOutput, error) { - ret := _m.Called(input) - - var r0 *v1.ProgressOutput - if rf, ok := ret.Get(0).(func(*v1.ProgressInput) *v1.ProgressOutput); ok { - r0 = rf(input) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.ProgressOutput) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(*v1.ProgressInput) error); ok { - r1 = rf(input) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// SnapshotItem provides a mock function with given fields: ctx, input -func (_m *ItemSnapshotter) SnapshotItem(ctx context.Context, input *v1.SnapshotItemInput) (*v1.SnapshotItemOutput, error) { - ret := _m.Called(ctx, input) - - var r0 *v1.SnapshotItemOutput - if rf, ok := ret.Get(0).(func(context.Context, *v1.SnapshotItemInput) *v1.SnapshotItemOutput); ok { - r0 = rf(ctx, input) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*v1.SnapshotItemOutput) - } - } - - var r1 error - if rf, ok := ret.Get(1).(func(context.Context, *v1.SnapshotItemInput) error); ok { - r1 = rf(ctx, input) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} diff --git a/pkg/restore/restore.go b/pkg/restore/restore.go index e030ae3211..3788e13452 100644 --- a/pkg/restore/restore.go +++ b/pkg/restore/restore.go @@ -83,7 +83,6 @@ type Restorer interface { RestoreWithResolvers( req *Request, restoreItemActionResolver framework.RestoreItemActionResolverV2, - itemSnapshotterResolver framework.ItemSnapshotterResolver, volumeSnapshotterGetter VolumeSnapshotterGetter, ) (Result, Result) } @@ -158,14 +157,12 @@ func (kr *kubernetesRestorer) Restore( volumeSnapshotterGetter VolumeSnapshotterGetter, ) (Result, Result) { resolver := framework.NewRestoreItemActionResolverV2(actions) - snapshotItemResolver := framework.NewItemSnapshotterResolver(nil) - return kr.RestoreWithResolvers(req, resolver, snapshotItemResolver, volumeSnapshotterGetter) + return kr.RestoreWithResolvers(req, resolver, volumeSnapshotterGetter) } func (kr *kubernetesRestorer) RestoreWithResolvers( req *Request, restoreItemActionResolver framework.RestoreItemActionResolverV2, - itemSnapshotterResolver framework.ItemSnapshotterResolver, volumeSnapshotterGetter VolumeSnapshotterGetter, ) (Result, Result) { // metav1.LabelSelectorAsSelector converts a nil LabelSelector to a @@ -221,11 +218,6 @@ func (kr *kubernetesRestorer) RestoreWithResolvers( return Result{}, Result{Velero: []string{err.Error()}} } - resolvedItemSnapshotterActions, err := itemSnapshotterResolver.ResolveActions(kr.discoveryHelper, kr.logger) - if err != nil { - return Result{}, Result{Velero: []string{err.Error()}} - } - podVolumeTimeout := kr.podVolumeTimeout if val := req.Restore.Annotations[velerov1api.PodVolumeOperationTimeoutAnnotation]; val != "" { parsed, err := time.ParseDuration(val) @@ -290,7 +282,6 @@ func (kr *kubernetesRestorer) RestoreWithResolvers( fileSystem: kr.fileSystem, namespaceClient: kr.namespaceClient, restoreItemActions: resolvedActions, - itemSnapshotterActions: resolvedItemSnapshotterActions, volumeSnapshotterGetter: volumeSnapshotterGetter, podVolumeRestorer: podVolumeRestorer, podVolumeErrs: make(chan error), @@ -333,7 +324,6 @@ type restoreContext struct { fileSystem filesystem.Interface namespaceClient corev1.NamespaceInterface restoreItemActions []framework.RestoreItemResolvedActionV2 - itemSnapshotterActions []framework.ItemSnapshotterResolvedAction volumeSnapshotterGetter VolumeSnapshotterGetter podVolumeRestorer podvolume.Restorer podVolumeWaitGroup sync.WaitGroup