mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-19 22:44:21 +00:00
Extract providers (#1985)
* Remove cloud providers and reorg code Signed-off-by: Carlisia <carlisia@vmware.com> * Update dependencies Signed-off-by: Carlisia <carlisia@vmware.com> * Fix tests Signed-off-by: Carlisia <carlisia@vmware.com> * fix dependency issues Signed-off-by: Carlisia <carlisia@vmware.com> * Delete dup test Signed-off-by: Carlisia <carlisia@vmware.com> * Add back spaces to file Signed-off-by: Carlisia <carlisia@vmware.com> * Remove and update docs Signed-off-by: Carlisia <carlisia@vmware.com> * Make the plugins flag required Signed-off-by: Carlisia <carlisia@vmware.com> * Add changelog Signed-off-by: Carlisia <carlisia@vmware.com> * Make the plugins flag conditional Signed-off-by: Carlisia <carlisia@vmware.com>
This commit is contained in:
committed by
Adnan Abdulhussein
parent
69f993aebd
commit
d26bf05b33
@@ -21,7 +21,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
|
||||
"github.com/hashicorp/go-hclog"
|
||||
hclog "github.com/hashicorp/go-hclog"
|
||||
hcplugin "github.com/hashicorp/go-plugin"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
cloudprovidermocks "github.com/vmware-tanzu/velero/pkg/cloudprovider/mocks"
|
||||
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
|
||||
providermocks "github.com/vmware-tanzu/velero/pkg/plugin/velero/mocks"
|
||||
)
|
||||
|
||||
func TestRestartableGetObjectStore(t *testing.T) {
|
||||
@@ -49,7 +49,7 @@ func TestRestartableGetObjectStore(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "happy path",
|
||||
plugin: new(cloudprovidermocks.ObjectStore),
|
||||
plugin: new(providermocks.ObjectStore),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ func TestRestartableObjectStoreReinitialize(t *testing.T) {
|
||||
err := r.reinitialize(3)
|
||||
assert.EqualError(t, err, "int is not a ObjectStore!")
|
||||
|
||||
objectStore := new(cloudprovidermocks.ObjectStore)
|
||||
objectStore := new(providermocks.ObjectStore)
|
||||
objectStore.Test(t)
|
||||
defer objectStore.AssertExpectations(t)
|
||||
|
||||
@@ -129,7 +129,7 @@ func TestRestartableObjectStoreGetDelegate(t *testing.T) {
|
||||
|
||||
// Happy path
|
||||
p.On("resetIfNeeded").Return(nil)
|
||||
objectStore := new(cloudprovidermocks.ObjectStore)
|
||||
objectStore := new(providermocks.ObjectStore)
|
||||
objectStore.Test(t)
|
||||
defer objectStore.AssertExpectations(t)
|
||||
p.On("getByKindAndName", key).Return(objectStore, nil)
|
||||
@@ -160,7 +160,7 @@ func TestRestartableObjectStoreInit(t *testing.T) {
|
||||
assert.EqualError(t, err, "getByKindAndName error")
|
||||
|
||||
// Delegate returns error
|
||||
objectStore := new(cloudprovidermocks.ObjectStore)
|
||||
objectStore := new(providermocks.ObjectStore)
|
||||
objectStore.Test(t)
|
||||
defer objectStore.AssertExpectations(t)
|
||||
p.On("getByKindAndName", key).Return(objectStore, nil)
|
||||
@@ -194,7 +194,7 @@ func TestRestartableObjectStoreDelegatedFunctions(t *testing.T) {
|
||||
}
|
||||
},
|
||||
func() mockable {
|
||||
return new(cloudprovidermocks.ObjectStore)
|
||||
return new(providermocks.ObjectStore)
|
||||
},
|
||||
restartableDelegateTest{
|
||||
function: "PutObject",
|
||||
|
||||
@@ -25,8 +25,8 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
|
||||
"github.com/vmware-tanzu/velero/pkg/cloudprovider/mocks"
|
||||
"github.com/vmware-tanzu/velero/pkg/plugin/framework"
|
||||
providermocks "github.com/vmware-tanzu/velero/pkg/plugin/velero/mocks"
|
||||
)
|
||||
|
||||
func TestRestartableGetVolumeSnapshotter(t *testing.T) {
|
||||
@@ -48,7 +48,7 @@ func TestRestartableGetVolumeSnapshotter(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "happy path",
|
||||
plugin: new(mocks.VolumeSnapshotter),
|
||||
plugin: new(providermocks.VolumeSnapshotter),
|
||||
},
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ func TestRestartableVolumeSnapshotterReinitialize(t *testing.T) {
|
||||
err := r.reinitialize(3)
|
||||
assert.EqualError(t, err, "int is not a VolumeSnapshotter!")
|
||||
|
||||
volumeSnapshotter := new(mocks.VolumeSnapshotter)
|
||||
volumeSnapshotter := new(providermocks.VolumeSnapshotter)
|
||||
volumeSnapshotter.Test(t)
|
||||
defer volumeSnapshotter.AssertExpectations(t)
|
||||
|
||||
@@ -128,7 +128,7 @@ func TestRestartableVolumeSnapshotterGetDelegate(t *testing.T) {
|
||||
|
||||
// Happy path
|
||||
p.On("resetIfNeeded").Return(nil)
|
||||
volumeSnapshotter := new(mocks.VolumeSnapshotter)
|
||||
volumeSnapshotter := new(providermocks.VolumeSnapshotter)
|
||||
volumeSnapshotter.Test(t)
|
||||
defer volumeSnapshotter.AssertExpectations(t)
|
||||
p.On("getByKindAndName", key).Return(volumeSnapshotter, nil)
|
||||
@@ -159,7 +159,7 @@ func TestRestartableVolumeSnapshotterInit(t *testing.T) {
|
||||
assert.EqualError(t, err, "getByKindAndName error")
|
||||
|
||||
// Delegate returns error
|
||||
volumeSnapshotter := new(mocks.VolumeSnapshotter)
|
||||
volumeSnapshotter := new(providermocks.VolumeSnapshotter)
|
||||
volumeSnapshotter.Test(t)
|
||||
defer volumeSnapshotter.AssertExpectations(t)
|
||||
p.On("getByKindAndName", key).Return(volumeSnapshotter, nil)
|
||||
@@ -205,7 +205,7 @@ func TestRestartableVolumeSnapshotterDelegatedFunctions(t *testing.T) {
|
||||
}
|
||||
},
|
||||
func() mockable {
|
||||
return new(mocks.VolumeSnapshotter)
|
||||
return new(providermocks.VolumeSnapshotter)
|
||||
},
|
||||
restartableDelegateTest{
|
||||
function: "CreateVolumeFromSnapshot",
|
||||
|
||||
Reference in New Issue
Block a user