mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-28 02:44:19 +00:00
add a BackupStore to pkg/persistence that supports prefixes
Signed-off-by: Steve Kriss <steve@heptio.com>
This commit is contained in:
@@ -110,3 +110,13 @@ func AssertDeepEqual(t *testing.T, expected, actual interface{}) bool {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// AssertErrorMatches asserts that if expected is the empty string, actual
|
||||
// is nil, otherwise, that actual's error string matches expected.
|
||||
func AssertErrorMatches(t *testing.T, expected string, actual error) bool {
|
||||
if expected != "" {
|
||||
return assert.EqualError(t, actual, expected)
|
||||
}
|
||||
|
||||
return assert.NoError(t, actual)
|
||||
}
|
||||
|
||||
@@ -98,13 +98,13 @@ func (_m *ObjectStore) Init(config map[string]string) error {
|
||||
return r0
|
||||
}
|
||||
|
||||
// ListCommonPrefixes provides a mock function with given fields: bucket, delimiter
|
||||
func (_m *ObjectStore) ListCommonPrefixes(bucket string, delimiter string) ([]string, error) {
|
||||
ret := _m.Called(bucket, delimiter)
|
||||
// ListCommonPrefixes provides a mock function with given fields: bucket, prefix, delimiter
|
||||
func (_m *ObjectStore) ListCommonPrefixes(bucket string, prefix string, delimiter string) ([]string, error) {
|
||||
ret := _m.Called(bucket, prefix, delimiter)
|
||||
|
||||
var r0 []string
|
||||
if rf, ok := ret.Get(0).(func(string, string) []string); ok {
|
||||
r0 = rf(bucket, delimiter)
|
||||
if rf, ok := ret.Get(0).(func(string, string, string) []string); ok {
|
||||
r0 = rf(bucket, prefix, delimiter)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).([]string)
|
||||
@@ -112,8 +112,8 @@ func (_m *ObjectStore) ListCommonPrefixes(bucket string, delimiter string) ([]st
|
||||
}
|
||||
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string) error); ok {
|
||||
r1 = rf(bucket, delimiter)
|
||||
if rf, ok := ret.Get(1).(func(string, string, string) error); ok {
|
||||
r1 = rf(bucket, prefix, delimiter)
|
||||
} else {
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user