Reformat and add version 2 to mock manager.

This commit is contained in:
Hoang, Phuong
2021-07-23 10:34:00 -07:00
committed by Bridget McErlean
parent f40f0d4e5b
commit 79d1616ecb
9 changed files with 43 additions and 29 deletions

View File

@@ -23,6 +23,7 @@ import (
"sync"
"github.com/sirupsen/logrus"
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
backupitemactionv2 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v2"
deleteitemactionv2 "github.com/vmware-tanzu/velero/pkg/plugin/velero/deleteitemaction/v2"

View File

@@ -20,12 +20,13 @@ import (
"context"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/runtime"
api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
backupitemactionv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v1"
backupitemactionv2 "github.com/vmware-tanzu/velero/pkg/plugin/velero/backupitemaction/v2"
"k8s.io/apimachinery/pkg/runtime"
)
type restartableAdaptedV1BackupItemAction struct {

View File

@@ -22,6 +22,7 @@ import (
"time"
"github.com/pkg/errors"
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
objectstorev1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/objectstore/v1"
objectstorev2 "github.com/vmware-tanzu/velero/pkg/plugin/velero/objectstore/v2"

View File

@@ -20,6 +20,7 @@ import (
"context"
"github.com/pkg/errors"
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
restoreitemactionv1 "github.com/vmware-tanzu/velero/pkg/plugin/velero/restoreitemaction/v1"

View File

@@ -21,9 +21,8 @@ import (
"github.com/pkg/errors"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
deleteitemactionv2 "github.com/vmware-tanzu/velero/pkg/plugin/velero/deleteitemaction/v2"
)

View File

@@ -20,6 +20,7 @@ import (
"context"
"github.com/pkg/errors"
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
"github.com/vmware-tanzu/velero/pkg/plugin/velero"
restoreitemactionv2 "github.com/vmware-tanzu/velero/pkg/plugin/velero/restoreitemaction/v2"

View File

@@ -118,7 +118,6 @@ func (r *restartableVolumeSnapshotter) CreateVolumeFromSnapshot(snapshotID strin
return delegate.CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ, iops)
}
// GetVolumeID restarts the plugin's process if needed, then delegates the call.
func (r *restartableVolumeSnapshotter) GetVolumeID(pv runtime.Unstructured) (string, error) {
delegate, err := r.getDelegate()
@@ -168,6 +167,7 @@ func (r *restartableVolumeSnapshotter) DeleteSnapshot(snapshotID string) error {
func (r *restartableVolumeSnapshotter) InitV2(ctx context.Context, config map[string]string) error {
return r.Init(config)
}
// CreateVolumeFromSnapshotV2 restarts the plugin's process if needed, then delegates the call.
func (r *restartableVolumeSnapshotter) CreateVolumeFromSnapshotV2(
ctx context.Context, snapshotID string, volumeType string, volumeAZ string, iops *int64) (volumeID string, err error) {