Merge pull request #1321 from skriss/rename-block-store

rename BlockStore to VolumeSnapshotter
This commit is contained in:
Nolan Brubaker
2019-03-28 11:33:06 -04:00
committed by GitHub
51 changed files with 592 additions and 590 deletions

View File

@@ -64,7 +64,7 @@ func (b *clientBuilder) clientConfig() *hcplugin.ClientConfig {
AllowedProtocols: []hcplugin.Protocol{hcplugin.ProtocolGRPC},
Plugins: map[string]hcplugin.Plugin{
string(framework.PluginKindBackupItemAction): framework.NewBackupItemActionPlugin(framework.ClientLogger(b.clientLogger)),
string(framework.PluginKindBlockStore): framework.NewBlockStorePlugin(framework.ClientLogger(b.clientLogger)),
string(framework.PluginKindVolumeSnapshotter): framework.NewVolumeSnapshotterPlugin(framework.ClientLogger(b.clientLogger)),
string(framework.PluginKindObjectStore): framework.NewObjectStorePlugin(framework.ClientLogger(b.clientLogger)),
string(framework.PluginKindPluginLister): &framework.PluginListerPlugin{},
string(framework.PluginKindRestoreItemAction): framework.NewRestoreItemActionPlugin(framework.ClientLogger(b.clientLogger)),
@@ -74,7 +74,7 @@ func (b *clientBuilder) clientConfig() *hcplugin.ClientConfig {
}
}
// client creates a new go-plugin Client with support for all of Velero's plugin kinds (BackupItemAction, BlockStore,
// client creates a new go-plugin Client with support for all of Velero's plugin kinds (BackupItemAction, VolumeSnapshotter,
// ObjectStore, PluginLister, RestoreItemAction).
func (b *clientBuilder) client() *hcplugin.Client {
return hcplugin.NewClient(b.clientConfig())

View File

@@ -53,7 +53,7 @@ func TestClientConfig(t *testing.T) {
AllowedProtocols: []hcplugin.Protocol{hcplugin.ProtocolGRPC},
Plugins: map[string]hcplugin.Plugin{
string(framework.PluginKindBackupItemAction): framework.NewBackupItemActionPlugin(framework.ClientLogger(logger)),
string(framework.PluginKindBlockStore): framework.NewBlockStorePlugin(framework.ClientLogger(logger)),
string(framework.PluginKindVolumeSnapshotter): framework.NewVolumeSnapshotterPlugin(framework.ClientLogger(logger)),
string(framework.PluginKindObjectStore): framework.NewObjectStorePlugin(framework.ClientLogger(logger)),
string(framework.PluginKindPluginLister): &framework.PluginListerPlugin{},
string(framework.PluginKindRestoreItemAction): framework.NewRestoreItemActionPlugin(framework.ClientLogger(logger)),

View File

@@ -30,8 +30,8 @@ type Manager interface {
// GetObjectStore returns the ObjectStore plugin for name.
GetObjectStore(name string) (velero.ObjectStore, error)
// GetBlockStore returns the BlockStore plugin for name.
GetBlockStore(name string) (velero.BlockStore, error)
// GetVolumeSnapshotter returns the VolumeSnapshotter plugin for name.
GetVolumeSnapshotter(name string) (velero.VolumeSnapshotter, error)
// GetBackupItemActions returns all backup item action plugins.
GetBackupItemActions() ([]velero.BackupItemAction, error)
@@ -134,14 +134,14 @@ func (m *manager) GetObjectStore(name string) (velero.ObjectStore, error) {
return r, nil
}
// GetBlockStore returns a restartableBlockStore for name.
func (m *manager) GetBlockStore(name string) (velero.BlockStore, error) {
restartableProcess, err := m.getRestartableProcess(framework.PluginKindBlockStore, name)
// GetVolumeSnapshotter returns a restartableVolumeSnapshotter for name.
func (m *manager) GetVolumeSnapshotter(name string) (velero.VolumeSnapshotter, error) {
restartableProcess, err := m.getRestartableProcess(framework.PluginKindVolumeSnapshotter, name)
if err != nil {
return nil, err
}
r := newRestartableBlockStore(name, restartableProcess)
r := newRestartableVolumeSnapshotter(name, restartableProcess)
return r, nil
}

View File

@@ -190,16 +190,16 @@ func TestGetObjectStore(t *testing.T) {
)
}
func TestGetBlockStore(t *testing.T) {
func TestGetVolumeSnapshotter(t *testing.T) {
getPluginTest(t,
framework.PluginKindBlockStore,
framework.PluginKindVolumeSnapshotter,
"aws",
func(m Manager, name string) (interface{}, error) {
return m.GetBlockStore(name)
return m.GetVolumeSnapshotter(name)
},
func(name string, sharedPluginProcess RestartableProcess) interface{} {
return &restartableBlockStore{
key: kindAndName{kind: framework.PluginKindBlockStore, name: name},
return &restartableVolumeSnapshotter{
key: kindAndName{kind: framework.PluginKindVolumeSnapshotter, name: name},
sharedPluginProcess: sharedPluginProcess,
}
},

View File

@@ -24,20 +24,20 @@ import (
"github.com/heptio/velero/pkg/plugin/velero"
)
// restartableBlockStore is an object store for a given implementation (such as "aws"). It is associated with
// restartableVolumeSnapshotter is a volume snapshotter for a given implementation (such as "aws"). It is associated with
// a restartableProcess, which may be shared and used to run multiple plugins. At the beginning of each method
// call, the restartableBlockStore asks its restartableProcess to restart itself if needed (e.g. if the
// call, the restartableVolumeSnapshotter asks its restartableProcess to restart itself if needed (e.g. if the
// process terminated for any reason), then it proceeds with the actual call.
type restartableBlockStore struct {
type restartableVolumeSnapshotter struct {
key kindAndName
sharedPluginProcess RestartableProcess
config map[string]string
}
// newRestartableBlockStore returns a new restartableBlockStore.
func newRestartableBlockStore(name string, sharedPluginProcess RestartableProcess) *restartableBlockStore {
key := kindAndName{kind: framework.PluginKindBlockStore, name: name}
r := &restartableBlockStore{
// newRestartableVolumeSnapshotter returns a new restartableVolumeSnapshotter.
func newRestartableVolumeSnapshotter(name string, sharedPluginProcess RestartableProcess) *restartableVolumeSnapshotter {
key := kindAndName{kind: framework.PluginKindVolumeSnapshotter, name: name}
r := &restartableVolumeSnapshotter{
key: key,
sharedPluginProcess: sharedPluginProcess,
}
@@ -49,48 +49,48 @@ func newRestartableBlockStore(name string, sharedPluginProcess RestartableProces
}
// reinitialize reinitializes a re-dispensed plugin using the initial data passed to Init().
func (r *restartableBlockStore) reinitialize(dispensed interface{}) error {
blockStore, ok := dispensed.(velero.BlockStore)
func (r *restartableVolumeSnapshotter) reinitialize(dispensed interface{}) error {
volumeSnapshotter, ok := dispensed.(velero.VolumeSnapshotter)
if !ok {
return errors.Errorf("%T is not a BlockStore!", dispensed)
return errors.Errorf("%T is not a VolumeSnapshotter!", dispensed)
}
return r.init(blockStore, r.config)
return r.init(volumeSnapshotter, r.config)
}
// getBlockStore returns the block store for this restartableBlockStore. It does *not* restart the
// getVolumeSnapshotter returns the volume snapshotter for this restartableVolumeSnapshotter. It does *not* restart the
// plugin process.
func (r *restartableBlockStore) getBlockStore() (velero.BlockStore, error) {
func (r *restartableVolumeSnapshotter) getVolumeSnapshotter() (velero.VolumeSnapshotter, error) {
plugin, err := r.sharedPluginProcess.getByKindAndName(r.key)
if err != nil {
return nil, err
}
blockStore, ok := plugin.(velero.BlockStore)
volumeSnapshotter, ok := plugin.(velero.VolumeSnapshotter)
if !ok {
return nil, errors.Errorf("%T is not a BlockStore!", plugin)
return nil, errors.Errorf("%T is not a VolumeSnapshotter!", plugin)
}
return blockStore, nil
return volumeSnapshotter, nil
}
// getDelegate restarts the plugin process (if needed) and returns the block store for this restartableBlockStore.
func (r *restartableBlockStore) getDelegate() (velero.BlockStore, error) {
// getDelegate restarts the plugin process (if needed) and returns the volume snapshotter for this restartableVolumeSnapshotter.
func (r *restartableVolumeSnapshotter) getDelegate() (velero.VolumeSnapshotter, error) {
if err := r.sharedPluginProcess.resetIfNeeded(); err != nil {
return nil, err
}
return r.getBlockStore()
return r.getVolumeSnapshotter()
}
// Init initializes the block store instance using config. If this is the first invocation, r stores config for future
// Init initializes the volume snapshotter instance using config. If this is the first invocation, r stores config for future
// reinitialization needs. Init does NOT restart the shared plugin process. Init may only be called once.
func (r *restartableBlockStore) Init(config map[string]string) error {
func (r *restartableVolumeSnapshotter) Init(config map[string]string) error {
if r.config != nil {
return errors.Errorf("already initialized")
}
// Not using getDelegate() to avoid possible infinite recursion
delegate, err := r.getBlockStore()
delegate, err := r.getVolumeSnapshotter()
if err != nil {
return err
}
@@ -100,14 +100,14 @@ func (r *restartableBlockStore) Init(config map[string]string) error {
return r.init(delegate, config)
}
// init calls Init on blockStore with config. This is split out from Init() so that both Init() and reinitialize() may
// call it using a specific BlockStore.
func (r *restartableBlockStore) init(blockStore velero.BlockStore, config map[string]string) error {
return blockStore.Init(config)
// init calls Init on volumeSnapshotter with config. This is split out from Init() so that both Init() and reinitialize() may
// call it using a specific VolumeSnapshotter.
func (r *restartableVolumeSnapshotter) init(volumeSnapshotter velero.VolumeSnapshotter, config map[string]string) error {
return volumeSnapshotter.Init(config)
}
// CreateVolumeFromSnapshot restarts the plugin's process if needed, then delegates the call.
func (r *restartableBlockStore) CreateVolumeFromSnapshot(snapshotID string, volumeType string, volumeAZ string, iops *int64) (volumeID string, err error) {
func (r *restartableVolumeSnapshotter) CreateVolumeFromSnapshot(snapshotID string, volumeType string, volumeAZ string, iops *int64) (volumeID string, err error) {
delegate, err := r.getDelegate()
if err != nil {
return "", err
@@ -116,7 +116,7 @@ func (r *restartableBlockStore) CreateVolumeFromSnapshot(snapshotID string, volu
}
// GetVolumeID restarts the plugin's process if needed, then delegates the call.
func (r *restartableBlockStore) GetVolumeID(pv runtime.Unstructured) (string, error) {
func (r *restartableVolumeSnapshotter) GetVolumeID(pv runtime.Unstructured) (string, error) {
delegate, err := r.getDelegate()
if err != nil {
return "", err
@@ -125,7 +125,7 @@ func (r *restartableBlockStore) GetVolumeID(pv runtime.Unstructured) (string, er
}
// SetVolumeID restarts the plugin's process if needed, then delegates the call.
func (r *restartableBlockStore) SetVolumeID(pv runtime.Unstructured, volumeID string) (runtime.Unstructured, error) {
func (r *restartableVolumeSnapshotter) SetVolumeID(pv runtime.Unstructured, volumeID string) (runtime.Unstructured, error) {
delegate, err := r.getDelegate()
if err != nil {
return nil, err
@@ -134,7 +134,7 @@ func (r *restartableBlockStore) SetVolumeID(pv runtime.Unstructured, volumeID st
}
// GetVolumeInfo restarts the plugin's process if needed, then delegates the call.
func (r *restartableBlockStore) GetVolumeInfo(volumeID string, volumeAZ string) (string, *int64, error) {
func (r *restartableVolumeSnapshotter) GetVolumeInfo(volumeID string, volumeAZ string) (string, *int64, error) {
delegate, err := r.getDelegate()
if err != nil {
return "", nil, err
@@ -143,7 +143,7 @@ func (r *restartableBlockStore) GetVolumeInfo(volumeID string, volumeAZ string)
}
// CreateSnapshot restarts the plugin's process if needed, then delegates the call.
func (r *restartableBlockStore) CreateSnapshot(volumeID string, volumeAZ string, tags map[string]string) (snapshotID string, err error) {
func (r *restartableVolumeSnapshotter) CreateSnapshot(volumeID string, volumeAZ string, tags map[string]string) (snapshotID string, err error) {
delegate, err := r.getDelegate()
if err != nil {
return "", err
@@ -152,7 +152,7 @@ func (r *restartableBlockStore) CreateSnapshot(volumeID string, volumeAZ string,
}
// DeleteSnapshot restarts the plugin's process if needed, then delegates the call.
func (r *restartableBlockStore) DeleteSnapshot(snapshotID string) error {
func (r *restartableVolumeSnapshotter) DeleteSnapshot(snapshotID string) error {
delegate, err := r.getDelegate()
if err != nil {
return err

View File

@@ -29,7 +29,7 @@ import (
"github.com/heptio/velero/pkg/plugin/framework"
)
func TestRestartableGetBlockStore(t *testing.T) {
func TestRestartableGetVolumeSnapshotter(t *testing.T) {
tests := []struct {
name string
plugin interface{}
@@ -44,11 +44,11 @@ func TestRestartableGetBlockStore(t *testing.T) {
{
name: "wrong type",
plugin: 3,
expectedError: "int is not a BlockStore!",
expectedError: "int is not a VolumeSnapshotter!",
},
{
name: "happy path",
plugin: new(mocks.BlockStore),
plugin: new(mocks.VolumeSnapshotter),
},
}
@@ -59,14 +59,14 @@ func TestRestartableGetBlockStore(t *testing.T) {
defer p.AssertExpectations(t)
name := "aws"
key := kindAndName{kind: framework.PluginKindBlockStore, name: name}
key := kindAndName{kind: framework.PluginKindVolumeSnapshotter, name: name}
p.On("getByKindAndName", key).Return(tc.plugin, tc.getError)
r := &restartableBlockStore{
r := &restartableVolumeSnapshotter{
key: key,
sharedPluginProcess: p,
}
a, err := r.getBlockStore()
a, err := r.getVolumeSnapshotter()
if tc.expectedError != "" {
assert.EqualError(t, err, tc.expectedError)
return
@@ -78,14 +78,14 @@ func TestRestartableGetBlockStore(t *testing.T) {
}
}
func TestRestartableBlockStoreReinitialize(t *testing.T) {
func TestRestartableVolumeSnapshotterReinitialize(t *testing.T) {
p := new(mockRestartableProcess)
p.Test(t)
defer p.AssertExpectations(t)
name := "aws"
key := kindAndName{kind: framework.PluginKindBlockStore, name: name}
r := &restartableBlockStore{
key := kindAndName{kind: framework.PluginKindVolumeSnapshotter, name: name}
r := &restartableVolumeSnapshotter{
key: key,
sharedPluginProcess: p,
config: map[string]string{
@@ -94,22 +94,22 @@ func TestRestartableBlockStoreReinitialize(t *testing.T) {
}
err := r.reinitialize(3)
assert.EqualError(t, err, "int is not a BlockStore!")
assert.EqualError(t, err, "int is not a VolumeSnapshotter!")
blockStore := new(mocks.BlockStore)
blockStore.Test(t)
defer blockStore.AssertExpectations(t)
volumeSnapshotter := new(mocks.VolumeSnapshotter)
volumeSnapshotter.Test(t)
defer volumeSnapshotter.AssertExpectations(t)
blockStore.On("Init", r.config).Return(errors.Errorf("init error")).Once()
err = r.reinitialize(blockStore)
volumeSnapshotter.On("Init", r.config).Return(errors.Errorf("init error")).Once()
err = r.reinitialize(volumeSnapshotter)
assert.EqualError(t, err, "init error")
blockStore.On("Init", r.config).Return(nil)
err = r.reinitialize(blockStore)
volumeSnapshotter.On("Init", r.config).Return(nil)
err = r.reinitialize(volumeSnapshotter)
assert.NoError(t, err)
}
func TestRestartableBlockStoreGetDelegate(t *testing.T) {
func TestRestartableVolumeSnapshotterGetDelegate(t *testing.T) {
p := new(mockRestartableProcess)
p.Test(t)
defer p.AssertExpectations(t)
@@ -117,8 +117,8 @@ func TestRestartableBlockStoreGetDelegate(t *testing.T) {
// Reset error
p.On("resetIfNeeded").Return(errors.Errorf("reset error")).Once()
name := "aws"
key := kindAndName{kind: framework.PluginKindBlockStore, name: name}
r := &restartableBlockStore{
key := kindAndName{kind: framework.PluginKindVolumeSnapshotter, name: name}
r := &restartableVolumeSnapshotter{
key: key,
sharedPluginProcess: p,
}
@@ -128,25 +128,25 @@ func TestRestartableBlockStoreGetDelegate(t *testing.T) {
// Happy path
p.On("resetIfNeeded").Return(nil)
blockStore := new(mocks.BlockStore)
blockStore.Test(t)
defer blockStore.AssertExpectations(t)
p.On("getByKindAndName", key).Return(blockStore, nil)
volumeSnapshotter := new(mocks.VolumeSnapshotter)
volumeSnapshotter.Test(t)
defer volumeSnapshotter.AssertExpectations(t)
p.On("getByKindAndName", key).Return(volumeSnapshotter, nil)
a, err = r.getDelegate()
assert.NoError(t, err)
assert.Equal(t, blockStore, a)
assert.Equal(t, volumeSnapshotter, a)
}
func TestRestartableBlockStoreInit(t *testing.T) {
func TestRestartableVolumeSnapshotterInit(t *testing.T) {
p := new(mockRestartableProcess)
p.Test(t)
defer p.AssertExpectations(t)
// getBlockStore error
// getVolumeSnapshottererror
name := "aws"
key := kindAndName{kind: framework.PluginKindBlockStore, name: name}
r := &restartableBlockStore{
key := kindAndName{kind: framework.PluginKindVolumeSnapshotter, name: name}
r := &restartableVolumeSnapshotter{
key: key,
sharedPluginProcess: p,
}
@@ -159,11 +159,11 @@ func TestRestartableBlockStoreInit(t *testing.T) {
assert.EqualError(t, err, "getByKindAndName error")
// Delegate returns error
blockStore := new(mocks.BlockStore)
blockStore.Test(t)
defer blockStore.AssertExpectations(t)
p.On("getByKindAndName", key).Return(blockStore, nil)
blockStore.On("Init", config).Return(errors.Errorf("Init error")).Once()
volumeSnapshotter := new(mocks.VolumeSnapshotter)
volumeSnapshotter.Test(t)
defer volumeSnapshotter.AssertExpectations(t)
p.On("getByKindAndName", key).Return(volumeSnapshotter, nil)
volumeSnapshotter.On("Init", config).Return(errors.Errorf("Init error")).Once()
err = r.Init(config)
assert.EqualError(t, err, "Init error")
@@ -172,7 +172,7 @@ func TestRestartableBlockStoreInit(t *testing.T) {
r.config = nil
// Happy path
blockStore.On("Init", config).Return(nil)
volumeSnapshotter.On("Init", config).Return(nil)
err = r.Init(config)
assert.NoError(t, err)
assert.Equal(t, config, r.config)
@@ -182,7 +182,7 @@ func TestRestartableBlockStoreInit(t *testing.T) {
assert.EqualError(t, err, "already initialized")
}
func TestRestartableBlockStoreDelegatedFunctions(t *testing.T) {
func TestRestartableVolumeSnapshotterDelegatedFunctions(t *testing.T) {
pv := &unstructured.Unstructured{
Object: map[string]interface{}{
"color": "blue",
@@ -197,15 +197,15 @@ func TestRestartableBlockStoreDelegatedFunctions(t *testing.T) {
runRestartableDelegateTests(
t,
framework.PluginKindBlockStore,
framework.PluginKindVolumeSnapshotter,
func(key kindAndName, p RestartableProcess) interface{} {
return &restartableBlockStore{
return &restartableVolumeSnapshotter{
key: key,
sharedPluginProcess: p,
}
},
func() mockable {
return new(mocks.BlockStore)
return new(mocks.VolumeSnapshotter)
},
restartableDelegateTest{
function: "CreateVolumeFromSnapshot",

View File

@@ -21,30 +21,30 @@ import (
"k8s.io/apimachinery/pkg/runtime"
)
func ExampleNewServer_blockStore() {
func ExampleNewServer_volumeSnapshotter() {
NewServer(). // call the server
RegisterBlockStore("example-blockstore", newBlockStore). // register the plugin
Serve() // serve the plugin
RegisterVolumeSnapshotter("example-volumesnapshotter", newVolumeSnapshotter). // register the plugin
Serve() // serve the plugin
}
func newBlockStore(logger logrus.FieldLogger) (interface{}, error) {
return &BlockStore{FieldLogger: logger}, nil
func newVolumeSnapshotter(logger logrus.FieldLogger) (interface{}, error) {
return &VolumeSnapshotter{FieldLogger: logger}, nil
}
type BlockStore struct {
type VolumeSnapshotter struct {
FieldLogger logrus.FieldLogger
}
// Implement all methods for the BlockStore interface...
func (b *BlockStore) Init(config map[string]string) error {
b.FieldLogger.Infof("BlockStore.Init called")
// Implement all methods for the VolumeSnapshotter interface...
func (b *VolumeSnapshotter) Init(config map[string]string) error {
b.FieldLogger.Infof("VolumeSnapshotter.Init called")
// ...
return nil
}
func (b *BlockStore) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ string, iops *int64) (volumeID string, err error) {
func (b *VolumeSnapshotter) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ string, iops *int64) (volumeID string, err error) {
b.FieldLogger.Infof("CreateVolumeFromSnapshot called")
// ...
@@ -52,7 +52,7 @@ func (b *BlockStore) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ s
return "volumeID", nil
}
func (b *BlockStore) GetVolumeID(pv runtime.Unstructured) (string, error) {
func (b *VolumeSnapshotter) GetVolumeID(pv runtime.Unstructured) (string, error) {
b.FieldLogger.Infof("GetVolumeID called")
// ...
@@ -60,7 +60,7 @@ func (b *BlockStore) GetVolumeID(pv runtime.Unstructured) (string, error) {
return "volumeID", nil
}
func (b *BlockStore) SetVolumeID(pv runtime.Unstructured, volumeID string) (runtime.Unstructured, error) {
func (b *VolumeSnapshotter) SetVolumeID(pv runtime.Unstructured, volumeID string) (runtime.Unstructured, error) {
b.FieldLogger.Infof("SetVolumeID called")
// ...
@@ -68,7 +68,7 @@ func (b *BlockStore) SetVolumeID(pv runtime.Unstructured, volumeID string) (runt
return nil, nil
}
func (b *BlockStore) GetVolumeInfo(volumeID, volumeAZ string) (string, *int64, error) {
func (b *VolumeSnapshotter) GetVolumeInfo(volumeID, volumeAZ string) (string, *int64, error) {
b.FieldLogger.Infof("GetVolumeInfo called")
// ...
@@ -76,7 +76,7 @@ func (b *BlockStore) GetVolumeInfo(volumeID, volumeAZ string) (string, *int64, e
return "volumeFilesystemType", nil, nil
}
func (b *BlockStore) CreateSnapshot(volumeID, volumeAZ string, tags map[string]string) (snapshotID string, err error) {
func (b *VolumeSnapshotter) CreateSnapshot(volumeID, volumeAZ string, tags map[string]string) (snapshotID string, err error) {
b.FieldLogger.Infof("CreateSnapshot called")
// ...
@@ -84,7 +84,7 @@ func (b *BlockStore) CreateSnapshot(volumeID, volumeAZ string, tags map[string]s
return "snapshotID", nil
}
func (b *BlockStore) DeleteSnapshot(snapshotID string) error {
func (b *VolumeSnapshotter) DeleteSnapshot(snapshotID string) error {
b.FieldLogger.Infof("DeleteSnapshot called")
// ...

View File

@@ -33,8 +33,8 @@ const (
// PluginKindObjectStore represents an object store plugin.
PluginKindObjectStore PluginKind = "ObjectStore"
// PluginKindBlockStore represents a block store plugin.
PluginKindBlockStore PluginKind = "BlockStore"
// PluginKindVolumeSnapshotter represents a volume snapshotter plugin.
PluginKindVolumeSnapshotter PluginKind = "VolumeSnapshotter"
// PluginKindBackupItemAction represents a backup item action plugin.
PluginKindBackupItemAction PluginKind = "BackupItemAction"
@@ -50,7 +50,7 @@ const (
// kind that a developer would ever need to implement (it's handled by Velero and the Velero plugin library code).
var allPluginKinds = sets.NewString(
PluginKindObjectStore.String(),
PluginKindBlockStore.String(),
PluginKindVolumeSnapshotter.String(),
PluginKindBackupItemAction.String(),
PluginKindRestoreItemAction.String(),
)

View File

@@ -25,7 +25,7 @@ import (
func TestAllPluginKinds(t *testing.T) {
expected := sets.NewString(
PluginKindObjectStore.String(),
PluginKindBlockStore.String(),
PluginKindVolumeSnapshotter.String(),
PluginKindBackupItemAction.String(),
PluginKindRestoreItemAction.String(),
)

View File

@@ -25,7 +25,7 @@ import (
func TestPluginImplementationsAreGRPCPlugins(t *testing.T) {
pluginImpls := []interface{}{
new(BlockStorePlugin),
new(VolumeSnapshotterPlugin),
new(BackupItemActionPlugin),
new(ObjectStorePlugin),
new(PluginListerPlugin),

View File

@@ -54,11 +54,11 @@ type Server interface {
// RegisterBackupItemActions registers multiple backup item actions.
RegisterBackupItemActions(map[string]HandlerInitializer) Server
// RegisterBlockStore registers a block store.
RegisterBlockStore(name string, initializer HandlerInitializer) Server
// RegisterVolumeSnapshotter registers a volume snapshotter.
RegisterVolumeSnapshotter(name string, initializer HandlerInitializer) Server
// RegisterBlockStores registers multiple block stores.
RegisterBlockStores(map[string]HandlerInitializer) Server
// RegisterVolumeSnapshotters registers multiple volume snapshotters.
RegisterVolumeSnapshotters(map[string]HandlerInitializer) Server
// RegisterObjectStore registers an object store.
RegisterObjectStore(name string, initializer HandlerInitializer) Server
@@ -82,7 +82,7 @@ type server struct {
logLevelFlag *logging.LevelFlag
flagSet *pflag.FlagSet
backupItemAction *BackupItemActionPlugin
blockStore *BlockStorePlugin
volumeSnapshotter *VolumeSnapshotterPlugin
objectStore *ObjectStorePlugin
restoreItemAction *RestoreItemActionPlugin
}
@@ -95,7 +95,7 @@ func NewServer() Server {
log: log,
logLevelFlag: logging.LogLevelFlag(log.Level),
backupItemAction: NewBackupItemActionPlugin(serverLogger(log)),
blockStore: NewBlockStorePlugin(serverLogger(log)),
volumeSnapshotter: NewVolumeSnapshotterPlugin(serverLogger(log)),
objectStore: NewObjectStorePlugin(serverLogger(log)),
restoreItemAction: NewRestoreItemActionPlugin(serverLogger(log)),
}
@@ -120,14 +120,14 @@ func (s *server) RegisterBackupItemActions(m map[string]HandlerInitializer) Serv
return s
}
func (s *server) RegisterBlockStore(name string, initializer HandlerInitializer) Server {
s.blockStore.register(name, initializer)
func (s *server) RegisterVolumeSnapshotter(name string, initializer HandlerInitializer) Server {
s.volumeSnapshotter.register(name, initializer)
return s
}
func (s *server) RegisterBlockStores(m map[string]HandlerInitializer) Server {
func (s *server) RegisterVolumeSnapshotters(m map[string]HandlerInitializer) Server {
for name := range m {
s.RegisterBlockStore(name, m[name])
s.RegisterVolumeSnapshotter(name, m[name])
}
return s
}
@@ -181,7 +181,7 @@ func (s *server) Serve() {
var pluginIdentifiers []PluginIdentifier
pluginIdentifiers = append(pluginIdentifiers, getNames(command, PluginKindBackupItemAction, s.backupItemAction)...)
pluginIdentifiers = append(pluginIdentifiers, getNames(command, PluginKindBlockStore, s.blockStore)...)
pluginIdentifiers = append(pluginIdentifiers, getNames(command, PluginKindVolumeSnapshotter, s.volumeSnapshotter)...)
pluginIdentifiers = append(pluginIdentifiers, getNames(command, PluginKindObjectStore, s.objectStore)...)
pluginIdentifiers = append(pluginIdentifiers, getNames(command, PluginKindRestoreItemAction, s.restoreItemAction)...)
@@ -191,7 +191,7 @@ func (s *server) Serve() {
HandshakeConfig: Handshake,
Plugins: map[string]plugin.Plugin{
string(PluginKindBackupItemAction): s.backupItemAction,
string(PluginKindBlockStore): s.blockStore,
string(PluginKindVolumeSnapshotter): s.volumeSnapshotter,
string(PluginKindObjectStore): s.objectStore,
string(PluginKindPluginLister): NewPluginListerPlugin(pluginLister),
string(PluginKindRestoreItemAction): s.restoreItemAction,

View File

@@ -23,7 +23,7 @@ import (
)
// HandlerInitializer is a function that initializes and returns a new instance of one of Velero's plugin interfaces
// (ObjectStore, BlockStore, BackupItemAction, RestoreItemAction).
// (ObjectStore, VolumeSnapshotter, BackupItemAction, RestoreItemAction).
type HandlerInitializer func(logger logrus.FieldLogger) (interface{}, error)
// serverMux manages multiple implementations of a single plugin kind, such as pod and pvc BackupItemActions.

View File

@@ -24,21 +24,21 @@ import (
proto "github.com/heptio/velero/pkg/plugin/generated"
)
// BlockStorePlugin is an implementation of go-plugin's Plugin
// interface with support for gRPC for the cloudprovider/BlockStore
// VolumeSnapshotterPlugin is an implementation of go-plugin's Plugin
// interface with support for gRPC for the cloudprovider/VolumeSnapshotter
// interface.
type BlockStorePlugin struct {
type VolumeSnapshotterPlugin struct {
plugin.NetRPCUnsupportedPlugin
*pluginBase
}
// GRPCClient returns a BlockStore gRPC client.
func (p *BlockStorePlugin) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, clientConn *grpc.ClientConn) (interface{}, error) {
return newClientDispenser(p.clientLogger, clientConn, newBlockStoreGRPCClient), nil
// GRPCClient returns a VolumeSnapshotter gRPC client.
func (p *VolumeSnapshotterPlugin) GRPCClient(_ context.Context, _ *plugin.GRPCBroker, clientConn *grpc.ClientConn) (interface{}, error) {
return newClientDispenser(p.clientLogger, clientConn, newVolumeSnapshotterGRPCClient), nil
}
// GRPCServer registers a BlockStore gRPC server.
func (p *BlockStorePlugin) GRPCServer(_ *plugin.GRPCBroker, server *grpc.Server) error {
proto.RegisterBlockStoreServer(server, &BlockStoreGRPCServer{mux: p.serverMux})
// GRPCServer registers a VolumeSnapshotter gRPC server.
func (p *VolumeSnapshotterPlugin) GRPCServer(_ *plugin.GRPCBroker, server *grpc.Server) error {
proto.RegisterVolumeSnapshotterServer(server, &VolumeSnapshotterGRPCServer{mux: p.serverMux})
return nil
}

View File

@@ -28,31 +28,31 @@ import (
proto "github.com/heptio/velero/pkg/plugin/generated"
)
// NewBlockStorePlugin constructs a BlockStorePlugin.
func NewBlockStorePlugin(options ...PluginOption) *BlockStorePlugin {
return &BlockStorePlugin{
// NewVolumeSnapshotterPlugin constructs a VolumeSnapshotterPlugin.
func NewVolumeSnapshotterPlugin(options ...PluginOption) *VolumeSnapshotterPlugin {
return &VolumeSnapshotterPlugin{
pluginBase: newPluginBase(options...),
}
}
// BlockStoreGRPCClient implements the cloudprovider.BlockStore interface and uses a
// VolumeSnapshotterGRPCClient implements the cloudprovider.VolumeSnapshotter interface and uses a
// gRPC client to make calls to the plugin server.
type BlockStoreGRPCClient struct {
type VolumeSnapshotterGRPCClient struct {
*clientBase
grpcClient proto.BlockStoreClient
grpcClient proto.VolumeSnapshotterClient
}
func newBlockStoreGRPCClient(base *clientBase, clientConn *grpc.ClientConn) interface{} {
return &BlockStoreGRPCClient{
func newVolumeSnapshotterGRPCClient(base *clientBase, clientConn *grpc.ClientConn) interface{} {
return &VolumeSnapshotterGRPCClient{
clientBase: base,
grpcClient: proto.NewBlockStoreClient(clientConn),
grpcClient: proto.NewVolumeSnapshotterClient(clientConn),
}
}
// Init prepares the BlockStore for usage using the provided map of
// configuration key-value pairs. It returns an error if the BlockStore
// Init prepares the VolumeSnapshotter for usage using the provided map of
// configuration key-value pairs. It returns an error if the VolumeSnapshotter
// cannot be initialized from the provided config.
func (c *BlockStoreGRPCClient) Init(config map[string]string) error {
func (c *VolumeSnapshotterGRPCClient) Init(config map[string]string) error {
req := &proto.InitRequest{
Plugin: c.plugin,
Config: config,
@@ -67,7 +67,7 @@ func (c *BlockStoreGRPCClient) Init(config map[string]string) error {
// CreateVolumeFromSnapshot creates a new block volume, initialized from the provided snapshot,
// and with the specified type and IOPS (if using provisioned IOPS).
func (c *BlockStoreGRPCClient) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ string, iops *int64) (string, error) {
func (c *VolumeSnapshotterGRPCClient) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ string, iops *int64) (string, error) {
req := &proto.CreateVolumeRequest{
Plugin: c.plugin,
SnapshotID: snapshotID,
@@ -91,7 +91,7 @@ func (c *BlockStoreGRPCClient) CreateVolumeFromSnapshot(snapshotID, volumeType,
// GetVolumeInfo returns the type and IOPS (if using provisioned IOPS) for a specified block
// volume.
func (c *BlockStoreGRPCClient) GetVolumeInfo(volumeID, volumeAZ string) (string, *int64, error) {
func (c *VolumeSnapshotterGRPCClient) GetVolumeInfo(volumeID, volumeAZ string) (string, *int64, error) {
req := &proto.GetVolumeInfoRequest{
Plugin: c.plugin,
VolumeID: volumeID,
@@ -113,7 +113,7 @@ func (c *BlockStoreGRPCClient) GetVolumeInfo(volumeID, volumeAZ string) (string,
// CreateSnapshot creates a snapshot of the specified block volume, and applies the provided
// set of tags to the snapshot.
func (c *BlockStoreGRPCClient) CreateSnapshot(volumeID, volumeAZ string, tags map[string]string) (string, error) {
func (c *VolumeSnapshotterGRPCClient) CreateSnapshot(volumeID, volumeAZ string, tags map[string]string) (string, error) {
req := &proto.CreateSnapshotRequest{
Plugin: c.plugin,
VolumeID: volumeID,
@@ -130,7 +130,7 @@ func (c *BlockStoreGRPCClient) CreateSnapshot(volumeID, volumeAZ string, tags ma
}
// DeleteSnapshot deletes the specified volume snapshot.
func (c *BlockStoreGRPCClient) DeleteSnapshot(snapshotID string) error {
func (c *VolumeSnapshotterGRPCClient) DeleteSnapshot(snapshotID string) error {
req := &proto.DeleteSnapshotRequest{
Plugin: c.plugin,
SnapshotID: snapshotID,
@@ -143,7 +143,7 @@ func (c *BlockStoreGRPCClient) DeleteSnapshot(snapshotID string) error {
return nil
}
func (c *BlockStoreGRPCClient) GetVolumeID(pv runtime.Unstructured) (string, error) {
func (c *VolumeSnapshotterGRPCClient) GetVolumeID(pv runtime.Unstructured) (string, error) {
encodedPV, err := json.Marshal(pv.UnstructuredContent())
if err != nil {
return "", errors.WithStack(err)
@@ -162,7 +162,7 @@ func (c *BlockStoreGRPCClient) GetVolumeID(pv runtime.Unstructured) (string, err
return resp.VolumeID, nil
}
func (c *BlockStoreGRPCClient) SetVolumeID(pv runtime.Unstructured, volumeID string) (runtime.Unstructured, error) {
func (c *VolumeSnapshotterGRPCClient) SetVolumeID(pv runtime.Unstructured, volumeID string) (runtime.Unstructured, error) {
encodedPV, err := json.Marshal(pv.UnstructuredContent())
if err != nil {
return nil, errors.WithStack(err)

View File

@@ -27,30 +27,30 @@ import (
"github.com/heptio/velero/pkg/plugin/velero"
)
// BlockStoreGRPCServer implements the proto-generated BlockStoreServer interface, and accepts
// VolumeSnapshotterGRPCServer implements the proto-generated VolumeSnapshotterServer interface, and accepts
// gRPC calls and forwards them to an implementation of the pluggable interface.
type BlockStoreGRPCServer struct {
type VolumeSnapshotterGRPCServer struct {
mux *serverMux
}
func (s *BlockStoreGRPCServer) getImpl(name string) (velero.BlockStore, error) {
func (s *VolumeSnapshotterGRPCServer) getImpl(name string) (velero.VolumeSnapshotter, error) {
impl, err := s.mux.getHandler(name)
if err != nil {
return nil, err
}
blockStore, ok := impl.(velero.BlockStore)
volumeSnapshotter, ok := impl.(velero.VolumeSnapshotter)
if !ok {
return nil, errors.Errorf("%T is not a block store", impl)
return nil, errors.Errorf("%T is not a volume snapshotter", impl)
}
return blockStore, nil
return volumeSnapshotter, nil
}
// Init prepares the BlockStore for usage using the provided map of
// configuration key-value pairs. It returns an error if the BlockStore
// Init prepares the VolumeSnapshotter for usage using the provided map of
// configuration key-value pairs. It returns an error if the VolumeSnapshotter
// cannot be initialized from the provided config.
func (s *BlockStoreGRPCServer) Init(ctx context.Context, req *proto.InitRequest) (response *proto.Empty, err error) {
func (s *VolumeSnapshotterGRPCServer) Init(ctx context.Context, req *proto.InitRequest) (response *proto.Empty, err error) {
defer func() {
if recoveredErr := handlePanic(recover()); recoveredErr != nil {
err = recoveredErr
@@ -71,7 +71,7 @@ func (s *BlockStoreGRPCServer) Init(ctx context.Context, req *proto.InitRequest)
// CreateVolumeFromSnapshot creates a new block volume, initialized from the provided snapshot,
// and with the specified type and IOPS (if using provisioned IOPS).
func (s *BlockStoreGRPCServer) CreateVolumeFromSnapshot(ctx context.Context, req *proto.CreateVolumeRequest) (response *proto.CreateVolumeResponse, err error) {
func (s *VolumeSnapshotterGRPCServer) CreateVolumeFromSnapshot(ctx context.Context, req *proto.CreateVolumeRequest) (response *proto.CreateVolumeResponse, err error) {
defer func() {
if recoveredErr := handlePanic(recover()); recoveredErr != nil {
err = recoveredErr
@@ -102,7 +102,7 @@ func (s *BlockStoreGRPCServer) CreateVolumeFromSnapshot(ctx context.Context, req
// GetVolumeInfo returns the type and IOPS (if using provisioned IOPS) for a specified block
// volume.
func (s *BlockStoreGRPCServer) GetVolumeInfo(ctx context.Context, req *proto.GetVolumeInfoRequest) (response *proto.GetVolumeInfoResponse, err error) {
func (s *VolumeSnapshotterGRPCServer) GetVolumeInfo(ctx context.Context, req *proto.GetVolumeInfoRequest) (response *proto.GetVolumeInfoResponse, err error) {
defer func() {
if recoveredErr := handlePanic(recover()); recoveredErr != nil {
err = recoveredErr
@@ -132,7 +132,7 @@ func (s *BlockStoreGRPCServer) GetVolumeInfo(ctx context.Context, req *proto.Get
// CreateSnapshot creates a snapshot of the specified block volume, and applies the provided
// set of tags to the snapshot.
func (s *BlockStoreGRPCServer) CreateSnapshot(ctx context.Context, req *proto.CreateSnapshotRequest) (response *proto.CreateSnapshotResponse, err error) {
func (s *VolumeSnapshotterGRPCServer) CreateSnapshot(ctx context.Context, req *proto.CreateSnapshotRequest) (response *proto.CreateSnapshotResponse, err error) {
defer func() {
if recoveredErr := handlePanic(recover()); recoveredErr != nil {
err = recoveredErr
@@ -153,7 +153,7 @@ func (s *BlockStoreGRPCServer) CreateSnapshot(ctx context.Context, req *proto.Cr
}
// DeleteSnapshot deletes the specified volume snapshot.
func (s *BlockStoreGRPCServer) DeleteSnapshot(ctx context.Context, req *proto.DeleteSnapshotRequest) (response *proto.Empty, err error) {
func (s *VolumeSnapshotterGRPCServer) DeleteSnapshot(ctx context.Context, req *proto.DeleteSnapshotRequest) (response *proto.Empty, err error) {
defer func() {
if recoveredErr := handlePanic(recover()); recoveredErr != nil {
err = recoveredErr
@@ -172,7 +172,7 @@ func (s *BlockStoreGRPCServer) DeleteSnapshot(ctx context.Context, req *proto.De
return &proto.Empty{}, nil
}
func (s *BlockStoreGRPCServer) GetVolumeID(ctx context.Context, req *proto.GetVolumeIDRequest) (response *proto.GetVolumeIDResponse, err error) {
func (s *VolumeSnapshotterGRPCServer) GetVolumeID(ctx context.Context, req *proto.GetVolumeIDRequest) (response *proto.GetVolumeIDResponse, err error) {
defer func() {
if recoveredErr := handlePanic(recover()); recoveredErr != nil {
err = recoveredErr
@@ -198,7 +198,7 @@ func (s *BlockStoreGRPCServer) GetVolumeID(ctx context.Context, req *proto.GetVo
return &proto.GetVolumeIDResponse{VolumeID: volumeID}, nil
}
func (s *BlockStoreGRPCServer) SetVolumeID(ctx context.Context, req *proto.SetVolumeIDRequest) (response *proto.SetVolumeIDResponse, err error) {
func (s *VolumeSnapshotterGRPCServer) SetVolumeID(ctx context.Context, req *proto.SetVolumeIDRequest) (response *proto.SetVolumeIDResponse, err error) {
defer func() {
if recoveredErr := handlePanic(recover()); recoveredErr != nil {
err = recoveredErr

View File

@@ -6,27 +6,16 @@ Package generated is a generated protocol buffer package.
It is generated from these files:
BackupItemAction.proto
BlockStore.proto
ObjectStore.proto
PluginLister.proto
RestoreItemAction.proto
Shared.proto
VolumeSnapshotter.proto
It has these top-level messages:
ExecuteRequest
ExecuteResponse
ResourceIdentifier
CreateVolumeRequest
CreateVolumeResponse
GetVolumeInfoRequest
GetVolumeInfoResponse
CreateSnapshotRequest
CreateSnapshotResponse
DeleteSnapshotRequest
GetVolumeIDRequest
GetVolumeIDResponse
SetVolumeIDRequest
SetVolumeIDResponse
PutObjectRequest
GetObjectRequest
Bytes
@@ -47,6 +36,17 @@ It has these top-level messages:
AppliesToResponse
Stack
StackFrame
CreateVolumeRequest
CreateVolumeResponse
GetVolumeInfoRequest
GetVolumeInfoResponse
CreateSnapshotRequest
CreateSnapshotResponse
DeleteSnapshotRequest
GetVolumeIDRequest
GetVolumeIDResponse
SetVolumeIDRequest
SetVolumeIDResponse
*/
package generated

View File

@@ -27,7 +27,7 @@ type PutObjectRequest struct {
func (m *PutObjectRequest) Reset() { *m = PutObjectRequest{} }
func (m *PutObjectRequest) String() string { return proto.CompactTextString(m) }
func (*PutObjectRequest) ProtoMessage() {}
func (*PutObjectRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{0} }
func (*PutObjectRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
func (m *PutObjectRequest) GetPlugin() string {
if m != nil {
@@ -66,7 +66,7 @@ type GetObjectRequest struct {
func (m *GetObjectRequest) Reset() { *m = GetObjectRequest{} }
func (m *GetObjectRequest) String() string { return proto.CompactTextString(m) }
func (*GetObjectRequest) ProtoMessage() {}
func (*GetObjectRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{1} }
func (*GetObjectRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} }
func (m *GetObjectRequest) GetPlugin() string {
if m != nil {
@@ -96,7 +96,7 @@ type Bytes struct {
func (m *Bytes) Reset() { *m = Bytes{} }
func (m *Bytes) String() string { return proto.CompactTextString(m) }
func (*Bytes) ProtoMessage() {}
func (*Bytes) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{2} }
func (*Bytes) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} }
func (m *Bytes) GetData() []byte {
if m != nil {
@@ -115,7 +115,7 @@ type ListCommonPrefixesRequest struct {
func (m *ListCommonPrefixesRequest) Reset() { *m = ListCommonPrefixesRequest{} }
func (m *ListCommonPrefixesRequest) String() string { return proto.CompactTextString(m) }
func (*ListCommonPrefixesRequest) ProtoMessage() {}
func (*ListCommonPrefixesRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} }
func (*ListCommonPrefixesRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} }
func (m *ListCommonPrefixesRequest) GetPlugin() string {
if m != nil {
@@ -152,7 +152,7 @@ type ListCommonPrefixesResponse struct {
func (m *ListCommonPrefixesResponse) Reset() { *m = ListCommonPrefixesResponse{} }
func (m *ListCommonPrefixesResponse) String() string { return proto.CompactTextString(m) }
func (*ListCommonPrefixesResponse) ProtoMessage() {}
func (*ListCommonPrefixesResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{4} }
func (*ListCommonPrefixesResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} }
func (m *ListCommonPrefixesResponse) GetPrefixes() []string {
if m != nil {
@@ -170,7 +170,7 @@ type ListObjectsRequest struct {
func (m *ListObjectsRequest) Reset() { *m = ListObjectsRequest{} }
func (m *ListObjectsRequest) String() string { return proto.CompactTextString(m) }
func (*ListObjectsRequest) ProtoMessage() {}
func (*ListObjectsRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{5} }
func (*ListObjectsRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} }
func (m *ListObjectsRequest) GetPlugin() string {
if m != nil {
@@ -200,7 +200,7 @@ type ListObjectsResponse struct {
func (m *ListObjectsResponse) Reset() { *m = ListObjectsResponse{} }
func (m *ListObjectsResponse) String() string { return proto.CompactTextString(m) }
func (*ListObjectsResponse) ProtoMessage() {}
func (*ListObjectsResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{6} }
func (*ListObjectsResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} }
func (m *ListObjectsResponse) GetKeys() []string {
if m != nil {
@@ -218,7 +218,7 @@ type DeleteObjectRequest struct {
func (m *DeleteObjectRequest) Reset() { *m = DeleteObjectRequest{} }
func (m *DeleteObjectRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteObjectRequest) ProtoMessage() {}
func (*DeleteObjectRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{7} }
func (*DeleteObjectRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} }
func (m *DeleteObjectRequest) GetPlugin() string {
if m != nil {
@@ -251,7 +251,7 @@ type CreateSignedURLRequest struct {
func (m *CreateSignedURLRequest) Reset() { *m = CreateSignedURLRequest{} }
func (m *CreateSignedURLRequest) String() string { return proto.CompactTextString(m) }
func (*CreateSignedURLRequest) ProtoMessage() {}
func (*CreateSignedURLRequest) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{8} }
func (*CreateSignedURLRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} }
func (m *CreateSignedURLRequest) GetPlugin() string {
if m != nil {
@@ -288,7 +288,7 @@ type CreateSignedURLResponse struct {
func (m *CreateSignedURLResponse) Reset() { *m = CreateSignedURLResponse{} }
func (m *CreateSignedURLResponse) String() string { return proto.CompactTextString(m) }
func (*CreateSignedURLResponse) ProtoMessage() {}
func (*CreateSignedURLResponse) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{9} }
func (*CreateSignedURLResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} }
func (m *CreateSignedURLResponse) GetUrl() string {
if m != nil {
@@ -642,9 +642,9 @@ var _ObjectStore_serviceDesc = grpc.ServiceDesc{
Metadata: "ObjectStore.proto",
}
func init() { proto.RegisterFile("ObjectStore.proto", fileDescriptor2) }
func init() { proto.RegisterFile("ObjectStore.proto", fileDescriptor1) }
var fileDescriptor2 = []byte{
var fileDescriptor1 = []byte{
// 468 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x51, 0x8b, 0xd3, 0x40,
0x10, 0x26, 0x26, 0x1e, 0x66, 0xae, 0x60, 0x9c, 0x83, 0x1a, 0x73, 0x2a, 0x75, 0x51, 0xa8, 0x08,

View File

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

View File

@@ -27,7 +27,7 @@ type RestoreExecuteRequest struct {
func (m *RestoreExecuteRequest) Reset() { *m = RestoreExecuteRequest{} }
func (m *RestoreExecuteRequest) String() string { return proto.CompactTextString(m) }
func (*RestoreExecuteRequest) ProtoMessage() {}
func (*RestoreExecuteRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} }
func (*RestoreExecuteRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} }
func (m *RestoreExecuteRequest) GetPlugin() string {
if m != nil {
@@ -65,7 +65,7 @@ type RestoreExecuteResponse struct {
func (m *RestoreExecuteResponse) Reset() { *m = RestoreExecuteResponse{} }
func (m *RestoreExecuteResponse) String() string { return proto.CompactTextString(m) }
func (*RestoreExecuteResponse) ProtoMessage() {}
func (*RestoreExecuteResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} }
func (*RestoreExecuteResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} }
func (m *RestoreExecuteResponse) GetItem() []byte {
if m != nil {
@@ -191,9 +191,9 @@ var _RestoreItemAction_serviceDesc = grpc.ServiceDesc{
Metadata: "RestoreItemAction.proto",
}
func init() { proto.RegisterFile("RestoreItemAction.proto", fileDescriptor4) }
func init() { proto.RegisterFile("RestoreItemAction.proto", fileDescriptor3) }
var fileDescriptor4 = []byte{
var fileDescriptor3 = []byte{
// 252 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x51, 0x4b, 0x4e, 0xc3, 0x30,
0x14, 0x94, 0xa1, 0x6a, 0x95, 0xa7, 0x0a, 0x89, 0x27, 0x51, 0xac, 0xc0, 0x22, 0x74, 0x81, 0xba,

View File

@@ -18,7 +18,7 @@ type Empty struct {
func (m *Empty) Reset() { *m = Empty{} }
func (m *Empty) String() string { return proto.CompactTextString(m) }
func (*Empty) ProtoMessage() {}
func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} }
func (*Empty) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} }
type InitRequest struct {
Plugin string `protobuf:"bytes,1,opt,name=plugin" json:"plugin,omitempty"`
@@ -28,7 +28,7 @@ type InitRequest struct {
func (m *InitRequest) Reset() { *m = InitRequest{} }
func (m *InitRequest) String() string { return proto.CompactTextString(m) }
func (*InitRequest) ProtoMessage() {}
func (*InitRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{1} }
func (*InitRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} }
func (m *InitRequest) GetPlugin() string {
if m != nil {
@@ -51,7 +51,7 @@ type AppliesToRequest struct {
func (m *AppliesToRequest) Reset() { *m = AppliesToRequest{} }
func (m *AppliesToRequest) String() string { return proto.CompactTextString(m) }
func (*AppliesToRequest) ProtoMessage() {}
func (*AppliesToRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{2} }
func (*AppliesToRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{2} }
func (m *AppliesToRequest) GetPlugin() string {
if m != nil {
@@ -71,7 +71,7 @@ type AppliesToResponse struct {
func (m *AppliesToResponse) Reset() { *m = AppliesToResponse{} }
func (m *AppliesToResponse) String() string { return proto.CompactTextString(m) }
func (*AppliesToResponse) ProtoMessage() {}
func (*AppliesToResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{3} }
func (*AppliesToResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{3} }
func (m *AppliesToResponse) GetIncludedNamespaces() []string {
if m != nil {
@@ -115,7 +115,7 @@ type Stack struct {
func (m *Stack) Reset() { *m = Stack{} }
func (m *Stack) String() string { return proto.CompactTextString(m) }
func (*Stack) ProtoMessage() {}
func (*Stack) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{4} }
func (*Stack) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{4} }
func (m *Stack) GetFrames() []*StackFrame {
if m != nil {
@@ -133,7 +133,7 @@ type StackFrame struct {
func (m *StackFrame) Reset() { *m = StackFrame{} }
func (m *StackFrame) String() string { return proto.CompactTextString(m) }
func (*StackFrame) ProtoMessage() {}
func (*StackFrame) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{5} }
func (*StackFrame) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{5} }
func (m *StackFrame) GetFile() string {
if m != nil {
@@ -165,9 +165,9 @@ func init() {
proto.RegisterType((*StackFrame)(nil), "generated.StackFrame")
}
func init() { proto.RegisterFile("Shared.proto", fileDescriptor5) }
func init() { proto.RegisterFile("Shared.proto", fileDescriptor4) }
var fileDescriptor5 = []byte{
var fileDescriptor4 = []byte{
// 345 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xc1, 0x4a, 0xeb, 0x40,
0x14, 0x86, 0x49, 0xd2, 0xe4, 0xde, 0x9e, 0xdc, 0x45, 0x3b, 0x5c, 0x25, 0x74, 0x55, 0xb2, 0x2a,

View File

@@ -1,5 +1,5 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: BlockStore.proto
// source: VolumeSnapshotter.proto
package generated
@@ -28,7 +28,7 @@ type CreateVolumeRequest struct {
func (m *CreateVolumeRequest) Reset() { *m = CreateVolumeRequest{} }
func (m *CreateVolumeRequest) String() string { return proto.CompactTextString(m) }
func (*CreateVolumeRequest) ProtoMessage() {}
func (*CreateVolumeRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} }
func (*CreateVolumeRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} }
func (m *CreateVolumeRequest) GetPlugin() string {
if m != nil {
@@ -72,7 +72,7 @@ type CreateVolumeResponse struct {
func (m *CreateVolumeResponse) Reset() { *m = CreateVolumeResponse{} }
func (m *CreateVolumeResponse) String() string { return proto.CompactTextString(m) }
func (*CreateVolumeResponse) ProtoMessage() {}
func (*CreateVolumeResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} }
func (*CreateVolumeResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{1} }
func (m *CreateVolumeResponse) GetVolumeID() string {
if m != nil {
@@ -90,7 +90,7 @@ type GetVolumeInfoRequest struct {
func (m *GetVolumeInfoRequest) Reset() { *m = GetVolumeInfoRequest{} }
func (m *GetVolumeInfoRequest) String() string { return proto.CompactTextString(m) }
func (*GetVolumeInfoRequest) ProtoMessage() {}
func (*GetVolumeInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} }
func (*GetVolumeInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{2} }
func (m *GetVolumeInfoRequest) GetPlugin() string {
if m != nil {
@@ -121,7 +121,7 @@ type GetVolumeInfoResponse struct {
func (m *GetVolumeInfoResponse) Reset() { *m = GetVolumeInfoResponse{} }
func (m *GetVolumeInfoResponse) String() string { return proto.CompactTextString(m) }
func (*GetVolumeInfoResponse) ProtoMessage() {}
func (*GetVolumeInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} }
func (*GetVolumeInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{3} }
func (m *GetVolumeInfoResponse) GetVolumeType() string {
if m != nil {
@@ -147,7 +147,7 @@ type CreateSnapshotRequest struct {
func (m *CreateSnapshotRequest) Reset() { *m = CreateSnapshotRequest{} }
func (m *CreateSnapshotRequest) String() string { return proto.CompactTextString(m) }
func (*CreateSnapshotRequest) ProtoMessage() {}
func (*CreateSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} }
func (*CreateSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{4} }
func (m *CreateSnapshotRequest) GetPlugin() string {
if m != nil {
@@ -184,7 +184,7 @@ type CreateSnapshotResponse struct {
func (m *CreateSnapshotResponse) Reset() { *m = CreateSnapshotResponse{} }
func (m *CreateSnapshotResponse) String() string { return proto.CompactTextString(m) }
func (*CreateSnapshotResponse) ProtoMessage() {}
func (*CreateSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{5} }
func (*CreateSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{5} }
func (m *CreateSnapshotResponse) GetSnapshotID() string {
if m != nil {
@@ -201,7 +201,7 @@ type DeleteSnapshotRequest struct {
func (m *DeleteSnapshotRequest) Reset() { *m = DeleteSnapshotRequest{} }
func (m *DeleteSnapshotRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteSnapshotRequest) ProtoMessage() {}
func (*DeleteSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{6} }
func (*DeleteSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{6} }
func (m *DeleteSnapshotRequest) GetPlugin() string {
if m != nil {
@@ -225,7 +225,7 @@ type GetVolumeIDRequest struct {
func (m *GetVolumeIDRequest) Reset() { *m = GetVolumeIDRequest{} }
func (m *GetVolumeIDRequest) String() string { return proto.CompactTextString(m) }
func (*GetVolumeIDRequest) ProtoMessage() {}
func (*GetVolumeIDRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{7} }
func (*GetVolumeIDRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{7} }
func (m *GetVolumeIDRequest) GetPlugin() string {
if m != nil {
@@ -248,7 +248,7 @@ type GetVolumeIDResponse struct {
func (m *GetVolumeIDResponse) Reset() { *m = GetVolumeIDResponse{} }
func (m *GetVolumeIDResponse) String() string { return proto.CompactTextString(m) }
func (*GetVolumeIDResponse) ProtoMessage() {}
func (*GetVolumeIDResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{8} }
func (*GetVolumeIDResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{8} }
func (m *GetVolumeIDResponse) GetVolumeID() string {
if m != nil {
@@ -266,7 +266,7 @@ type SetVolumeIDRequest struct {
func (m *SetVolumeIDRequest) Reset() { *m = SetVolumeIDRequest{} }
func (m *SetVolumeIDRequest) String() string { return proto.CompactTextString(m) }
func (*SetVolumeIDRequest) ProtoMessage() {}
func (*SetVolumeIDRequest) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{9} }
func (*SetVolumeIDRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{9} }
func (m *SetVolumeIDRequest) GetPlugin() string {
if m != nil {
@@ -296,7 +296,7 @@ type SetVolumeIDResponse struct {
func (m *SetVolumeIDResponse) Reset() { *m = SetVolumeIDResponse{} }
func (m *SetVolumeIDResponse) String() string { return proto.CompactTextString(m) }
func (*SetVolumeIDResponse) ProtoMessage() {}
func (*SetVolumeIDResponse) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{10} }
func (*SetVolumeIDResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{10} }
func (m *SetVolumeIDResponse) GetPersistentVolume() []byte {
if m != nil {
@@ -327,9 +327,9 @@ var _ grpc.ClientConn
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4
// Client API for BlockStore service
// Client API for VolumeSnapshotter service
type BlockStoreClient interface {
type VolumeSnapshotterClient interface {
Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*Empty, error)
CreateVolumeFromSnapshot(ctx context.Context, in *CreateVolumeRequest, opts ...grpc.CallOption) (*CreateVolumeResponse, error)
GetVolumeInfo(ctx context.Context, in *GetVolumeInfoRequest, opts ...grpc.CallOption) (*GetVolumeInfoResponse, error)
@@ -339,80 +339,80 @@ type BlockStoreClient interface {
SetVolumeID(ctx context.Context, in *SetVolumeIDRequest, opts ...grpc.CallOption) (*SetVolumeIDResponse, error)
}
type blockStoreClient struct {
type volumeSnapshotterClient struct {
cc *grpc.ClientConn
}
func NewBlockStoreClient(cc *grpc.ClientConn) BlockStoreClient {
return &blockStoreClient{cc}
func NewVolumeSnapshotterClient(cc *grpc.ClientConn) VolumeSnapshotterClient {
return &volumeSnapshotterClient{cc}
}
func (c *blockStoreClient) Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*Empty, error) {
func (c *volumeSnapshotterClient) Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := grpc.Invoke(ctx, "/generated.BlockStore/Init", in, out, c.cc, opts...)
err := grpc.Invoke(ctx, "/generated.VolumeSnapshotter/Init", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blockStoreClient) CreateVolumeFromSnapshot(ctx context.Context, in *CreateVolumeRequest, opts ...grpc.CallOption) (*CreateVolumeResponse, error) {
func (c *volumeSnapshotterClient) CreateVolumeFromSnapshot(ctx context.Context, in *CreateVolumeRequest, opts ...grpc.CallOption) (*CreateVolumeResponse, error) {
out := new(CreateVolumeResponse)
err := grpc.Invoke(ctx, "/generated.BlockStore/CreateVolumeFromSnapshot", in, out, c.cc, opts...)
err := grpc.Invoke(ctx, "/generated.VolumeSnapshotter/CreateVolumeFromSnapshot", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blockStoreClient) GetVolumeInfo(ctx context.Context, in *GetVolumeInfoRequest, opts ...grpc.CallOption) (*GetVolumeInfoResponse, error) {
func (c *volumeSnapshotterClient) GetVolumeInfo(ctx context.Context, in *GetVolumeInfoRequest, opts ...grpc.CallOption) (*GetVolumeInfoResponse, error) {
out := new(GetVolumeInfoResponse)
err := grpc.Invoke(ctx, "/generated.BlockStore/GetVolumeInfo", in, out, c.cc, opts...)
err := grpc.Invoke(ctx, "/generated.VolumeSnapshotter/GetVolumeInfo", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blockStoreClient) CreateSnapshot(ctx context.Context, in *CreateSnapshotRequest, opts ...grpc.CallOption) (*CreateSnapshotResponse, error) {
func (c *volumeSnapshotterClient) CreateSnapshot(ctx context.Context, in *CreateSnapshotRequest, opts ...grpc.CallOption) (*CreateSnapshotResponse, error) {
out := new(CreateSnapshotResponse)
err := grpc.Invoke(ctx, "/generated.BlockStore/CreateSnapshot", in, out, c.cc, opts...)
err := grpc.Invoke(ctx, "/generated.VolumeSnapshotter/CreateSnapshot", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blockStoreClient) DeleteSnapshot(ctx context.Context, in *DeleteSnapshotRequest, opts ...grpc.CallOption) (*Empty, error) {
func (c *volumeSnapshotterClient) DeleteSnapshot(ctx context.Context, in *DeleteSnapshotRequest, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := grpc.Invoke(ctx, "/generated.BlockStore/DeleteSnapshot", in, out, c.cc, opts...)
err := grpc.Invoke(ctx, "/generated.VolumeSnapshotter/DeleteSnapshot", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blockStoreClient) GetVolumeID(ctx context.Context, in *GetVolumeIDRequest, opts ...grpc.CallOption) (*GetVolumeIDResponse, error) {
func (c *volumeSnapshotterClient) GetVolumeID(ctx context.Context, in *GetVolumeIDRequest, opts ...grpc.CallOption) (*GetVolumeIDResponse, error) {
out := new(GetVolumeIDResponse)
err := grpc.Invoke(ctx, "/generated.BlockStore/GetVolumeID", in, out, c.cc, opts...)
err := grpc.Invoke(ctx, "/generated.VolumeSnapshotter/GetVolumeID", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *blockStoreClient) SetVolumeID(ctx context.Context, in *SetVolumeIDRequest, opts ...grpc.CallOption) (*SetVolumeIDResponse, error) {
func (c *volumeSnapshotterClient) SetVolumeID(ctx context.Context, in *SetVolumeIDRequest, opts ...grpc.CallOption) (*SetVolumeIDResponse, error) {
out := new(SetVolumeIDResponse)
err := grpc.Invoke(ctx, "/generated.BlockStore/SetVolumeID", in, out, c.cc, opts...)
err := grpc.Invoke(ctx, "/generated.VolumeSnapshotter/SetVolumeID", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for BlockStore service
// Server API for VolumeSnapshotter service
type BlockStoreServer interface {
type VolumeSnapshotterServer interface {
Init(context.Context, *InitRequest) (*Empty, error)
CreateVolumeFromSnapshot(context.Context, *CreateVolumeRequest) (*CreateVolumeResponse, error)
GetVolumeInfo(context.Context, *GetVolumeInfoRequest) (*GetVolumeInfoResponse, error)
@@ -422,208 +422,208 @@ type BlockStoreServer interface {
SetVolumeID(context.Context, *SetVolumeIDRequest) (*SetVolumeIDResponse, error)
}
func RegisterBlockStoreServer(s *grpc.Server, srv BlockStoreServer) {
s.RegisterService(&_BlockStore_serviceDesc, srv)
func RegisterVolumeSnapshotterServer(s *grpc.Server, srv VolumeSnapshotterServer) {
s.RegisterService(&_VolumeSnapshotter_serviceDesc, srv)
}
func _BlockStore_Init_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _VolumeSnapshotter_Init_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(InitRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlockStoreServer).Init(ctx, in)
return srv.(VolumeSnapshotterServer).Init(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/generated.BlockStore/Init",
FullMethod: "/generated.VolumeSnapshotter/Init",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlockStoreServer).Init(ctx, req.(*InitRequest))
return srv.(VolumeSnapshotterServer).Init(ctx, req.(*InitRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlockStore_CreateVolumeFromSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _VolumeSnapshotter_CreateVolumeFromSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateVolumeRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlockStoreServer).CreateVolumeFromSnapshot(ctx, in)
return srv.(VolumeSnapshotterServer).CreateVolumeFromSnapshot(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/generated.BlockStore/CreateVolumeFromSnapshot",
FullMethod: "/generated.VolumeSnapshotter/CreateVolumeFromSnapshot",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlockStoreServer).CreateVolumeFromSnapshot(ctx, req.(*CreateVolumeRequest))
return srv.(VolumeSnapshotterServer).CreateVolumeFromSnapshot(ctx, req.(*CreateVolumeRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlockStore_GetVolumeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _VolumeSnapshotter_GetVolumeInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetVolumeInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlockStoreServer).GetVolumeInfo(ctx, in)
return srv.(VolumeSnapshotterServer).GetVolumeInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/generated.BlockStore/GetVolumeInfo",
FullMethod: "/generated.VolumeSnapshotter/GetVolumeInfo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlockStoreServer).GetVolumeInfo(ctx, req.(*GetVolumeInfoRequest))
return srv.(VolumeSnapshotterServer).GetVolumeInfo(ctx, req.(*GetVolumeInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlockStore_CreateSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _VolumeSnapshotter_CreateSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateSnapshotRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlockStoreServer).CreateSnapshot(ctx, in)
return srv.(VolumeSnapshotterServer).CreateSnapshot(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/generated.BlockStore/CreateSnapshot",
FullMethod: "/generated.VolumeSnapshotter/CreateSnapshot",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlockStoreServer).CreateSnapshot(ctx, req.(*CreateSnapshotRequest))
return srv.(VolumeSnapshotterServer).CreateSnapshot(ctx, req.(*CreateSnapshotRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlockStore_DeleteSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _VolumeSnapshotter_DeleteSnapshot_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteSnapshotRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlockStoreServer).DeleteSnapshot(ctx, in)
return srv.(VolumeSnapshotterServer).DeleteSnapshot(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/generated.BlockStore/DeleteSnapshot",
FullMethod: "/generated.VolumeSnapshotter/DeleteSnapshot",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlockStoreServer).DeleteSnapshot(ctx, req.(*DeleteSnapshotRequest))
return srv.(VolumeSnapshotterServer).DeleteSnapshot(ctx, req.(*DeleteSnapshotRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlockStore_GetVolumeID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _VolumeSnapshotter_GetVolumeID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetVolumeIDRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlockStoreServer).GetVolumeID(ctx, in)
return srv.(VolumeSnapshotterServer).GetVolumeID(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/generated.BlockStore/GetVolumeID",
FullMethod: "/generated.VolumeSnapshotter/GetVolumeID",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlockStoreServer).GetVolumeID(ctx, req.(*GetVolumeIDRequest))
return srv.(VolumeSnapshotterServer).GetVolumeID(ctx, req.(*GetVolumeIDRequest))
}
return interceptor(ctx, in, info, handler)
}
func _BlockStore_SetVolumeID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _VolumeSnapshotter_SetVolumeID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetVolumeIDRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BlockStoreServer).SetVolumeID(ctx, in)
return srv.(VolumeSnapshotterServer).SetVolumeID(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/generated.BlockStore/SetVolumeID",
FullMethod: "/generated.VolumeSnapshotter/SetVolumeID",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BlockStoreServer).SetVolumeID(ctx, req.(*SetVolumeIDRequest))
return srv.(VolumeSnapshotterServer).SetVolumeID(ctx, req.(*SetVolumeIDRequest))
}
return interceptor(ctx, in, info, handler)
}
var _BlockStore_serviceDesc = grpc.ServiceDesc{
ServiceName: "generated.BlockStore",
HandlerType: (*BlockStoreServer)(nil),
var _VolumeSnapshotter_serviceDesc = grpc.ServiceDesc{
ServiceName: "generated.VolumeSnapshotter",
HandlerType: (*VolumeSnapshotterServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Init",
Handler: _BlockStore_Init_Handler,
Handler: _VolumeSnapshotter_Init_Handler,
},
{
MethodName: "CreateVolumeFromSnapshot",
Handler: _BlockStore_CreateVolumeFromSnapshot_Handler,
Handler: _VolumeSnapshotter_CreateVolumeFromSnapshot_Handler,
},
{
MethodName: "GetVolumeInfo",
Handler: _BlockStore_GetVolumeInfo_Handler,
Handler: _VolumeSnapshotter_GetVolumeInfo_Handler,
},
{
MethodName: "CreateSnapshot",
Handler: _BlockStore_CreateSnapshot_Handler,
Handler: _VolumeSnapshotter_CreateSnapshot_Handler,
},
{
MethodName: "DeleteSnapshot",
Handler: _BlockStore_DeleteSnapshot_Handler,
Handler: _VolumeSnapshotter_DeleteSnapshot_Handler,
},
{
MethodName: "GetVolumeID",
Handler: _BlockStore_GetVolumeID_Handler,
Handler: _VolumeSnapshotter_GetVolumeID_Handler,
},
{
MethodName: "SetVolumeID",
Handler: _BlockStore_SetVolumeID_Handler,
Handler: _VolumeSnapshotter_SetVolumeID_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "BlockStore.proto",
Metadata: "VolumeSnapshotter.proto",
}
func init() { proto.RegisterFile("BlockStore.proto", fileDescriptor1) }
func init() { proto.RegisterFile("VolumeSnapshotter.proto", fileDescriptor5) }
var fileDescriptor1 = []byte{
// 527 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x4f, 0x6f, 0xd3, 0x4e,
0x10, 0x95, 0x63, 0xb7, 0xfa, 0x65, 0xd2, 0x5f, 0x15, 0x4d, 0xfe, 0xc8, 0xb2, 0x44, 0x30, 0x3e,
0x45, 0x3d, 0x44, 0x10, 0x0e, 0x54, 0x1c, 0x90, 0x0a, 0x2e, 0x28, 0xa2, 0x12, 0x92, 0x5d, 0x10,
0x82, 0x93, 0xa1, 0xd3, 0x34, 0xaa, 0xe3, 0x35, 0xde, 0x4d, 0xa5, 0x7c, 0x18, 0xee, 0x7c, 0x2c,
0x3e, 0x0a, 0x8a, 0xbd, 0x49, 0x76, 0x93, 0x4d, 0xd3, 0x4b, 0x6f, 0x9e, 0x19, 0xcf, 0x9b, 0xf7,
0xc6, 0x6f, 0xd7, 0xd0, 0x7c, 0x9b, 0xb2, 0x9f, 0xb7, 0xb1, 0x60, 0x05, 0x0d, 0xf2, 0x82, 0x09,
0x86, 0xf5, 0x31, 0x65, 0x54, 0x24, 0x82, 0xae, 0xbc, 0xa3, 0xf8, 0x26, 0x29, 0xe8, 0xaa, 0x2a,
0x04, 0xbf, 0x2d, 0x68, 0xbd, 0x2b, 0x28, 0x11, 0xf4, 0x85, 0xa5, 0xb3, 0x29, 0x45, 0xf4, 0x6b,
0x46, 0x5c, 0x60, 0x17, 0x0e, 0xf3, 0x74, 0x36, 0x9e, 0x64, 0xae, 0xe5, 0x5b, 0xfd, 0x7a, 0x24,
0x23, 0xec, 0x01, 0xf0, 0x2c, 0xc9, 0xf9, 0x0d, 0x13, 0xa3, 0xd0, 0xad, 0x95, 0x35, 0x25, 0xb3,
0xa8, 0xdf, 0x95, 0x40, 0x97, 0xf3, 0x9c, 0x5c, 0xbb, 0xaa, 0xaf, 0x33, 0xe8, 0xc1, 0x7f, 0x55,
0x74, 0xf6, 0xcd, 0x75, 0xca, 0xea, 0x2a, 0x46, 0x04, 0x67, 0xc2, 0x72, 0xee, 0x1e, 0xf8, 0x56,
0xdf, 0x8e, 0xca, 0xe7, 0x60, 0x08, 0x6d, 0x9d, 0x1e, 0xcf, 0x59, 0xc6, 0x15, 0x9c, 0x51, 0x28,
0x19, 0xae, 0xe2, 0xe0, 0x1a, 0xda, 0x1f, 0x48, 0x54, 0x0d, 0xa3, 0xec, 0x9a, 0xed, 0xd3, 0xa4,
0x62, 0xd5, 0x74, 0x2c, 0x8d, 0xaf, 0xad, 0xf3, 0x0d, 0x3e, 0x42, 0x67, 0x63, 0x8e, 0x24, 0xa7,
0x2f, 0xc1, 0xda, 0x5a, 0xc2, 0x52, 0x68, 0x4d, 0x11, 0xfa, 0xd7, 0x82, 0x4e, 0xa5, 0x34, 0x96,
0xdb, 0x7c, 0x24, 0xda, 0xf8, 0x06, 0x1c, 0x91, 0x8c, 0xb9, 0xeb, 0xf8, 0x76, 0xbf, 0x31, 0x3c,
0x19, 0xac, 0xac, 0x31, 0x30, 0xce, 0x1f, 0x5c, 0x26, 0x63, 0x7e, 0x9e, 0x89, 0x62, 0x1e, 0x95,
0x7d, 0xde, 0x2b, 0xa8, 0xaf, 0x52, 0xd8, 0x04, 0xfb, 0x96, 0xe6, 0x92, 0xd9, 0xe2, 0x11, 0xdb,
0x70, 0x70, 0x97, 0xa4, 0x33, 0x92, 0x9c, 0xaa, 0xe0, 0x75, 0xed, 0xd4, 0x0a, 0x4e, 0xa1, 0xbb,
0x39, 0x61, 0xbd, 0x30, 0xc5, 0x55, 0xd6, 0xa6, 0xab, 0x82, 0x4f, 0xd0, 0x09, 0x29, 0xa5, 0x87,
0xef, 0x66, 0x8f, 0x4d, 0x83, 0xaf, 0x80, 0xeb, 0x4f, 0x17, 0xee, 0x43, 0x3b, 0x81, 0x66, 0x4e,
0x05, 0x9f, 0x70, 0x41, 0x99, 0x6c, 0x2a, 0x31, 0x8f, 0xa2, 0xad, 0x7c, 0xf0, 0x02, 0x5a, 0x1a,
0xf2, 0x03, 0xfc, 0x2a, 0x00, 0xe3, 0x47, 0x21, 0xa3, 0x4d, 0xb5, 0x37, 0xa6, 0x9e, 0x41, 0x2b,
0x36, 0x10, 0x35, 0xc1, 0x5b, 0x66, 0xf8, 0xe1, 0x1f, 0x07, 0x60, 0x7d, 0xd5, 0xe0, 0x73, 0x70,
0x46, 0xd9, 0x44, 0x60, 0x57, 0xb1, 0xd4, 0x22, 0x21, 0x15, 0x79, 0x4d, 0x25, 0x7f, 0x3e, 0xcd,
0xc5, 0x1c, 0xbf, 0x83, 0xab, 0x9e, 0xee, 0xf7, 0x05, 0x9b, 0x2e, 0xbf, 0x30, 0xf6, 0xb6, 0x8c,
0xa9, 0xdd, 0x50, 0xde, 0xd3, 0x9d, 0x75, 0xa9, 0x24, 0x82, 0xff, 0xb5, 0xe3, 0x89, 0x6a, 0x87,
0xe9, 0x82, 0xf0, 0xfc, 0xdd, 0x2f, 0x48, 0xcc, 0xcf, 0x70, 0xac, 0x5b, 0x18, 0xfd, 0x7d, 0xe7,
0xc7, 0x7b, 0x76, 0xcf, 0x1b, 0x12, 0x36, 0x84, 0x63, 0xdd, 0xdf, 0x1a, 0xac, 0xd1, 0xfa, 0x86,
0x6d, 0x5e, 0x40, 0x43, 0xb1, 0x1e, 0x3e, 0x31, 0xaa, 0x59, 0xfa, 0xcb, 0xeb, 0xed, 0x2a, 0x4b,
0x4e, 0x17, 0xd0, 0x88, 0x77, 0xa0, 0xc5, 0xf7, 0xa3, 0x19, 0x6c, 0xf5, 0xe3, 0xb0, 0xfc, 0xdd,
0xbc, 0xfc, 0x17, 0x00, 0x00, 0xff, 0xff, 0xae, 0x59, 0x98, 0xf2, 0x9b, 0x06, 0x00, 0x00,
var fileDescriptor5 = []byte{
// 525 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcd, 0x6e, 0xd3, 0x40,
0x10, 0xd6, 0xc6, 0x6e, 0x45, 0x26, 0xa5, 0x0a, 0x93, 0x1f, 0x2c, 0x4b, 0x04, 0xe3, 0x53, 0xd4,
0x43, 0x04, 0xe1, 0x40, 0xc5, 0x01, 0xa9, 0xc2, 0x05, 0x45, 0x54, 0x42, 0xb2, 0x0b, 0x42, 0x70,
0x32, 0xea, 0x34, 0x8d, 0x48, 0x6c, 0xe3, 0xdd, 0x54, 0xca, 0xc3, 0xf0, 0x0c, 0xbc, 0x12, 0x8f,
0x82, 0x62, 0x6f, 0x92, 0xdd, 0x64, 0x53, 0xf7, 0xd2, 0x9b, 0x67, 0x66, 0xe7, 0x9b, 0x6f, 0x66,
0xbf, 0x59, 0xc3, 0xd3, 0xaf, 0xe9, 0x74, 0x3e, 0xa3, 0x28, 0x89, 0x33, 0x7e, 0x93, 0x0a, 0x41,
0xf9, 0x20, 0xcb, 0x53, 0x91, 0x62, 0x7d, 0x4c, 0x09, 0xe5, 0xb1, 0xa0, 0x2b, 0xf7, 0x28, 0xba,
0x89, 0x73, 0xba, 0x2a, 0x03, 0xfe, 0x1f, 0x06, 0xad, 0xf7, 0x39, 0xc5, 0x82, 0xca, 0xd4, 0x90,
0x7e, 0xcf, 0x89, 0x0b, 0xec, 0xc2, 0x61, 0x36, 0x9d, 0x8f, 0x27, 0x89, 0xc3, 0x3c, 0xd6, 0xaf,
0x87, 0xd2, 0xc2, 0x1e, 0x00, 0x97, 0xe8, 0xa3, 0xc0, 0xa9, 0x15, 0x31, 0xc5, 0xb3, 0x8c, 0xdf,
0x16, 0x40, 0x97, 0x8b, 0x8c, 0x1c, 0xab, 0x8c, 0x6f, 0x3c, 0xe8, 0xc2, 0xa3, 0xd2, 0x3a, 0xfb,
0xee, 0xd8, 0x45, 0x74, 0x6d, 0x23, 0x82, 0x3d, 0x49, 0x33, 0xee, 0x1c, 0x78, 0xac, 0x6f, 0x85,
0xc5, 0xb7, 0x3f, 0x84, 0xb6, 0x4e, 0x8f, 0x67, 0x69, 0xc2, 0x15, 0x9c, 0x51, 0x20, 0x19, 0xae,
0x6d, 0xff, 0x1a, 0xda, 0x1f, 0x49, 0x94, 0x09, 0xa3, 0xe4, 0x3a, 0xad, 0xea, 0x49, 0xc5, 0xaa,
0xe9, 0x58, 0x1a, 0x5f, 0x4b, 0xe7, 0xeb, 0x7f, 0x82, 0xce, 0x56, 0x1d, 0x49, 0x4e, 0x1f, 0x02,
0xdb, 0x19, 0xc2, 0xaa, 0xd1, 0x9a, 0xd2, 0xe8, 0x3f, 0x06, 0x9d, 0xb2, 0xd3, 0xd5, 0xed, 0x3d,
0x10, 0x6d, 0x7c, 0x07, 0xb6, 0x88, 0xc7, 0xdc, 0xb1, 0x3d, 0xab, 0xdf, 0x18, 0x9e, 0x0c, 0xd6,
0xd2, 0x18, 0x18, 0xeb, 0x0f, 0x2e, 0xe3, 0x31, 0x3f, 0x4f, 0x44, 0xbe, 0x08, 0x8b, 0x3c, 0xf7,
0x0d, 0xd4, 0xd7, 0x2e, 0x6c, 0x82, 0xf5, 0x8b, 0x16, 0x92, 0xd9, 0xf2, 0x13, 0xdb, 0x70, 0x70,
0x1b, 0x4f, 0xe7, 0x24, 0x39, 0x95, 0xc6, 0xdb, 0xda, 0x29, 0xf3, 0x4f, 0xa1, 0xbb, 0x5d, 0x61,
0x33, 0x30, 0x45, 0x55, 0x6c, 0x5b, 0x55, 0xfe, 0x67, 0xe8, 0x04, 0x34, 0xa5, 0xfb, 0xcf, 0xa6,
0x42, 0xa6, 0xfe, 0x37, 0xc0, 0xcd, 0xd5, 0x05, 0x55, 0x68, 0x27, 0xd0, 0xcc, 0x28, 0xe7, 0x13,
0x2e, 0x28, 0x91, 0x49, 0x05, 0xe6, 0x51, 0xb8, 0xe3, 0xf7, 0x5f, 0x41, 0x4b, 0x43, 0xbe, 0x87,
0x5e, 0x05, 0x60, 0xf4, 0x20, 0x64, 0xb4, 0xaa, 0xd6, 0x56, 0xd5, 0x33, 0x68, 0x45, 0x06, 0xa2,
0x26, 0x78, 0x66, 0x86, 0x1f, 0xfe, 0xb5, 0xe1, 0xc9, 0xce, 0x8b, 0x83, 0x2f, 0xc1, 0x1e, 0x25,
0x13, 0x81, 0x5d, 0x45, 0x59, 0x4b, 0x87, 0x6c, 0xcc, 0x6d, 0x2a, 0xfe, 0xf3, 0x59, 0x26, 0x16,
0xf8, 0x03, 0x1c, 0x75, 0xc9, 0x3f, 0xe4, 0xe9, 0x6c, 0x05, 0x88, 0xbd, 0x1d, 0x7d, 0x6a, 0x0f,
0x95, 0xfb, 0x7c, 0x6f, 0x5c, 0x36, 0x14, 0xc2, 0x63, 0x6d, 0x4b, 0x51, 0xcd, 0x30, 0xbd, 0x13,
0xae, 0xb7, 0xff, 0x80, 0xc4, 0xfc, 0x02, 0xc7, 0xba, 0x92, 0xd1, 0xab, 0x5a, 0x23, 0xf7, 0xc5,
0x1d, 0x27, 0x24, 0x6c, 0x00, 0xc7, 0xba, 0xcc, 0x35, 0x58, 0xe3, 0x06, 0x18, 0xa6, 0x79, 0x01,
0x0d, 0x45, 0x81, 0xf8, 0xcc, 0xd8, 0xcd, 0x4a, 0x66, 0x6e, 0x6f, 0x5f, 0x58, 0x72, 0xba, 0x80,
0x46, 0xb4, 0x07, 0x2d, 0xba, 0x1b, 0xcd, 0xa0, 0xae, 0x9f, 0x87, 0xc5, 0x5f, 0xe7, 0xf5, 0xff,
0x00, 0x00, 0x00, 0xff, 0xff, 0x29, 0x03, 0xe3, 0x22, 0xa9, 0x06, 0x00, 0x00,
}

View File

@@ -78,16 +78,16 @@ func (_m *Manager) GetBackupItemActions() ([]velero.BackupItemAction, error) {
return r0, r1
}
// GetBlockStore provides a mock function with given fields: name
func (_m *Manager) GetBlockStore(name string) (velero.BlockStore, error) {
// GetVolumeSnapshotter provides a mock function with given fields: name
func (_m *Manager) GetVolumeSnapshotter(name string) (velero.VolumeSnapshotter, error) {
ret := _m.Called(name)
var r0 velero.BlockStore
if rf, ok := ret.Get(0).(func(string) velero.BlockStore); ok {
var r0 velero.VolumeSnapshotter
if rf, ok := ret.Get(0).(func(string) velero.VolumeSnapshotter); ok {
r0 = rf(name)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(velero.BlockStore)
r0 = ret.Get(0).(velero.VolumeSnapshotter)
}
}

View File

@@ -61,7 +61,7 @@ message SetVolumeIDResponse {
bytes persistentVolume = 1;
}
service BlockStore {
service VolumeSnapshotter {
rpc Init(InitRequest) returns (Empty);
rpc CreateVolumeFromSnapshot(CreateVolumeRequest) returns (CreateVolumeResponse);
rpc GetVolumeInfo(GetVolumeInfoRequest) returns (GetVolumeInfoResponse);

View File

@@ -1,5 +1,5 @@
/*
Copyright 2017 the Velero contributors.
Copyright 2017, 2019 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.
@@ -20,15 +20,16 @@ import (
"k8s.io/apimachinery/pkg/runtime"
)
// BlockStore exposes basic block-storage operations required
// by Velero.
type BlockStore interface {
// Init prepares the BlockStore for usage using the provided map of
// configuration key-value pairs. It returns an error if the BlockStore
// VolumeSnapshotter defines the operations needed by Velero to
// take snapshots of persistent volumes during backup, and to restore
// persistent volumes from snapshots during restore.
type VolumeSnapshotter interface {
// Init prepares the VolumeSnapshotter for usage using the provided map of
// configuration key-value pairs. It returns an error if the VolumeSnapshotter
// cannot be initialized from the provided config.
Init(config map[string]string) error
// CreateVolumeFromSnapshot creates a new block volume in the specified
// CreateVolumeFromSnapshot creates a new volume in the specified
// availability zone, initialized from the provided snapshot,
// and with the specified type and IOPS (if using provisioned IOPS).
CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ string, iops *int64) (volumeID string, err error)
@@ -40,10 +41,10 @@ type BlockStore interface {
SetVolumeID(pv runtime.Unstructured, volumeID string) (runtime.Unstructured, error)
// GetVolumeInfo returns the type and IOPS (if using provisioned IOPS) for
// the specified block volume in the given availability zone.
// the specified volume in the given availability zone.
GetVolumeInfo(volumeID, volumeAZ string) (string, *int64, error)
// CreateSnapshot creates a snapshot of the specified block volume, and applies the provided
// CreateSnapshot creates a snapshot of the specified volume, and applies the provided
// set of tags to the snapshot.
CreateSnapshot(volumeID, volumeAZ string, tags map[string]string) (snapshotID string, err error)