mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-19 22:44:21 +00:00
Uploader interface fo block data mover
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Uploader interface for block data mover
|
||||
@@ -396,7 +396,7 @@ func TestBackupPodVolumes(t *testing.T) {
|
||||
},
|
||||
uploaderType: "fake-uploader-type",
|
||||
errs: []string{
|
||||
"invalid uploader type 'fake-uploader-type', valid type: 'kopia'",
|
||||
"invalid uploader type 'fake-uploader-type', valid types: 'kopia', 'velero-block'",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@ import (
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/vmware-tanzu/velero/internal/credentials"
|
||||
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
|
||||
repokeys "github.com/vmware-tanzu/velero/pkg/repository/keys"
|
||||
@@ -34,7 +35,6 @@ type blockProvider struct {
|
||||
bkRepo udmrepo.BackupRepo
|
||||
credGetter *credentials.CredentialGetter
|
||||
log logrus.FieldLogger
|
||||
canceling int32
|
||||
}
|
||||
|
||||
// NewBlockUploaderProvider initialized with open or create a repository
|
||||
@@ -100,8 +100,7 @@ func (bp *blockProvider) RunBackup(
|
||||
volMode uploader.PersistentVolumeMode,
|
||||
uploaderCfg map[string]string,
|
||||
updater uploader.ProgressUpdater) (string, bool, int64, int64, error) {
|
||||
|
||||
return "", false, 0, 0, nil
|
||||
return "", false, 0, 0, errors.New("block backup not implemented")
|
||||
}
|
||||
|
||||
// TODO: implement in the following PRs
|
||||
@@ -112,5 +111,5 @@ func (bp *blockProvider) RunRestore(
|
||||
volMode uploader.PersistentVolumeMode,
|
||||
uploaderCfg map[string]string,
|
||||
updater uploader.ProgressUpdater) (int64, error) {
|
||||
return 0, nil
|
||||
return 0, errors.New("block restore not implemented")
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ func TestBlockProviderClose(t *testing.T) {
|
||||
}
|
||||
|
||||
err := bp.Close(t.Context())
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
mockBRepo.AssertExpectations(t)
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ const (
|
||||
func ValidateUploaderType(t string) (string, error) {
|
||||
t = strings.TrimSpace(t)
|
||||
if t != KopiaType && t != BlockType {
|
||||
return "", fmt.Errorf("invalid uploader type '%s', valid type: '%s'", t, KopiaType)
|
||||
return "", fmt.Errorf("invalid uploader type '%s', valid types: '%s', '%s'", t, KopiaType, BlockType)
|
||||
}
|
||||
|
||||
return "", nil
|
||||
|
||||
@@ -23,7 +23,7 @@ func TestValidateUploaderType(t *testing.T) {
|
||||
{
|
||||
"'anything_else' is invalid",
|
||||
"anything_else",
|
||||
"invalid uploader type 'anything_else', valid type: 'kopia'",
|
||||
"invalid uploader type 'anything_else', valid types: 'kopia', 'velero-block'",
|
||||
"",
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user