Documentation ¶
Overview ¶
Code generated by mockery v1.0.0
Code generated by mockery v1.0.0
Index ¶
- func AssertDeepEqual(t *testing.T, expected, actual interface{}) bool
- func CompareActions(t *testing.T, expected, actual []core.Action)
- func GetAsMap(j string) (map[string]interface{}, error)
- func NewLogger() logrus.FieldLogger
- func TimesAreEqual(t1, t2 time.Time) bool
- func UnstructuredOrDie(data string) *unstructured.Unstructured
- func ValidatePatch(t *testing.T, action core.Action, expected interface{}, ...)
- type BackupService
- func (_m *BackupService) CreateSignedURL(target v1.DownloadTarget, bucket, directory string, ttl time.Duration) (string, error)
- func (_m *BackupService) DeleteBackupDir(bucket string, backupName string) error
- func (_m *BackupService) DownloadBackup(bucket string, name string) (io.ReadCloser, error)
- func (_m *BackupService) GetAllBackups(bucket string) ([]*v1.Backup, error)
- func (_m *BackupService) GetBackup(bucket string, name string) (*v1.Backup, error)
- func (_m *BackupService) UploadBackup(bucket string, name string, metadata io.Reader, backup io.Reader, ...) error
- func (_m *BackupService) UploadRestoreLog(bucket string, backup string, restore string, log io.Reader) error
- func (_m *BackupService) UploadRestoreResults(bucket string, backup string, restore string, results io.Reader) error
- type FakeBackupService
- func (f *FakeBackupService) DeleteBackup(bucket, backupName string) error
- func (f *FakeBackupService) DownloadBackup(bucket, name string) (io.ReadCloser, error)
- func (f *FakeBackupService) GetAllBackups(bucket string) ([]*v1.Backup, error)
- func (f *FakeBackupService) GetBackup(bucket, name string) (*v1.Backup, error)
- func (f *FakeBackupService) UploadBackup(bucket, name string, metadata, backup io.Reader) error
- type FakeDiscoveryHelper
- type FakeDynamicClient
- func (c *FakeDynamicClient) Create(obj *unstructured.Unstructured) (*unstructured.Unstructured, error)
- func (c *FakeDynamicClient) Get(name string, opts metav1.GetOptions) (*unstructured.Unstructured, error)
- func (c *FakeDynamicClient) List(options metav1.ListOptions) (runtime.Object, error)
- func (c *FakeDynamicClient) Patch(name string, data []byte) (*unstructured.Unstructured, error)
- func (c *FakeDynamicClient) Watch(options metav1.ListOptions) (watch.Interface, error)
- type FakeDynamicFactory
- type FakeFileSystem
- func (fs *FakeFileSystem) Create(name string) (io.WriteCloser, error)
- func (fs *FakeFileSystem) DirExists(path string) (bool, error)
- func (fs *FakeFileSystem) MkdirAll(path string, perm os.FileMode) error
- func (fs *FakeFileSystem) ReadDir(dirname string) ([]os.FileInfo, error)
- func (fs *FakeFileSystem) ReadFile(filename string) ([]byte, error)
- func (fs *FakeFileSystem) RemoveAll(path string) error
- func (fs *FakeFileSystem) TempDir(dir, prefix string) (string, error)
- func (fs *FakeFileSystem) WithDirectories(path ...string) *FakeFileSystem
- func (fs *FakeFileSystem) WithDirectory(path string) *FakeFileSystem
- func (fs *FakeFileSystem) WithFile(path string, data []byte) *FakeFileSystem
- type FakeMapper
- type FakeSnapshotService
- func (s *FakeSnapshotService) CreateSnapshot(volumeID, volumeAZ string, tags map[string]string) (string, error)
- func (s *FakeSnapshotService) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ string, iops *int64) (string, error)
- func (s *FakeSnapshotService) DeleteSnapshot(snapshotID string) error
- func (s *FakeSnapshotService) GetVolumeID(pv runtime.Unstructured) (string, error)
- func (s *FakeSnapshotService) GetVolumeInfo(volumeID, volumeAZ string) (string, *int64, error)
- func (s *FakeSnapshotService) SetVolumeID(pv runtime.Unstructured, volumeID string) (runtime.Unstructured, error)
- type MockPodCommandExecutor
- type ObjectStore
- func (_m *ObjectStore) CreateSignedURL(bucket string, key string, ttl time.Duration) (string, error)
- func (_m *ObjectStore) DeleteObject(bucket string, key string) error
- func (_m *ObjectStore) GetObject(bucket string, key string) (io.ReadCloser, error)
- func (_m *ObjectStore) Init(config map[string]string) error
- func (_m *ObjectStore) ListCommonPrefixes(bucket string, delimiter string) ([]string, error)
- func (_m *ObjectStore) ListObjects(bucket string, prefix string) ([]string, error)
- func (_m *ObjectStore) PutObject(bucket string, key string, body io.Reader) error
- type TestBackup
- func (b *TestBackup) WithDeletionTimestamp(time time.Time) *TestBackup
- func (b *TestBackup) WithExcludedNamespaces(ns ...string) *TestBackup
- func (b *TestBackup) WithExcludedResources(r ...string) *TestBackup
- func (b *TestBackup) WithExpiration(expiration time.Time) *TestBackup
- func (b *TestBackup) WithFinalizers(finalizers ...string) *TestBackup
- func (b *TestBackup) WithIncludedNamespaces(ns ...string) *TestBackup
- func (b *TestBackup) WithIncludedResources(r ...string) *TestBackup
- func (b *TestBackup) WithLabel(key, value string) *TestBackup
- func (b *TestBackup) WithName(name string) *TestBackup
- func (b *TestBackup) WithNamespace(namespace string) *TestBackup
- func (b *TestBackup) WithPhase(phase v1.BackupPhase) *TestBackup
- func (b *TestBackup) WithResourceVersion(version string) *TestBackup
- func (b *TestBackup) WithSnapshot(pv string, snapshot string) *TestBackup
- func (b *TestBackup) WithSnapshotVolumes(value bool) *TestBackup
- func (b *TestBackup) WithSnapshotVolumesPointer(value *bool) *TestBackup
- func (b *TestBackup) WithTTL(ttl time.Duration) *TestBackup
- func (b *TestBackup) WithVersion(version int) *TestBackup
- type TestRestore
- func (r *TestRestore) WithBackup(name string) *TestRestore
- func (r *TestRestore) WithErrors(i int) *TestRestore
- func (r *TestRestore) WithExcludedNamespace(name string) *TestRestore
- func (r *TestRestore) WithExcludedResource(resource string) *TestRestore
- func (r *TestRestore) WithIncludedNamespace(name string) *TestRestore
- func (r *TestRestore) WithIncludedResource(resource string) *TestRestore
- func (r *TestRestore) WithMappedNamespace(from string, to string) *TestRestore
- func (r *TestRestore) WithRestorePVs(value bool) *TestRestore
- func (r *TestRestore) WithValidationError(err string) *TestRestore
- type TestSchedule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertDeepEqual ¶ added in v0.9.0
AssertDeepEqual asserts the semantic equality of objects. This function exists in order to make sure time.Time and metav1.Time objects can be compared correctly. See https://github.com/stretchr/testify/issues/502.
func CompareActions ¶ added in v0.8.0
CompareActions checks slices of actual and expected Actions for equality (ignoring order). It checks that the lengths of the slices are the same, that each actual Action has a corresponding expected Action, and that each expected Action has a corresponding actual Action.
func NewLogger ¶ added in v0.5.0
func NewLogger() logrus.FieldLogger
func TimesAreEqual ¶ added in v0.9.0
TimesAreEqual compares two times for equality. This function is used by equality.Semantic.DeepEqual to compare two time objects without having to call a method.
func UnstructuredOrDie ¶ added in v0.9.0
func UnstructuredOrDie(data string) *unstructured.Unstructured
func ValidatePatch ¶ added in v0.9.0
func ValidatePatch(t *testing.T, action core.Action, expected interface{}, decodeFunc func(*json.Decoder) (interface{}, error))
ValidatePatch tests the validity of an action. It checks that the action is a PatchAction, that the patch decodes from JSON with the provided decode func and has no extraneous fields, and that the decoded patch matches the expected.
Types ¶
type BackupService ¶ added in v0.4.0
BackupService is an autogenerated mock type for the BackupService type
func (*BackupService) CreateSignedURL ¶ added in v0.4.0
func (_m *BackupService) CreateSignedURL(target v1.DownloadTarget, bucket, directory string, ttl time.Duration) (string, error)
CreateSignedURL provides a mock function with given fields: target, bucket, ttl
func (*BackupService) DeleteBackupDir ¶ added in v0.4.0
func (_m *BackupService) DeleteBackupDir(bucket string, backupName string) error
DeleteBackupDir provides a mock function with given fields: bucket, backupName
func (*BackupService) DownloadBackup ¶ added in v0.4.0
func (_m *BackupService) DownloadBackup(bucket string, name string) (io.ReadCloser, error)
DownloadBackup provides a mock function with given fields: bucket, name
func (*BackupService) GetAllBackups ¶ added in v0.4.0
func (_m *BackupService) GetAllBackups(bucket string) ([]*v1.Backup, error)
GetAllBackups provides a mock function with given fields: bucket
func (*BackupService) GetBackup ¶ added in v0.4.0
GetBackup provides a mock function with given fields: bucket, name
func (*BackupService) UploadBackup ¶ added in v0.4.0
func (_m *BackupService) UploadBackup(bucket string, name string, metadata io.Reader, backup io.Reader, log io.Reader) error
UploadBackup provides a mock function with given fields: bucket, name, metadata, backup, log
func (*BackupService) UploadRestoreLog ¶ added in v0.4.0
func (_m *BackupService) UploadRestoreLog(bucket string, backup string, restore string, log io.Reader) error
UploadRestoreLog provides a mock function with given fields: bucket, backup, restore, log
func (*BackupService) UploadRestoreResults ¶ added in v0.6.0
func (_m *BackupService) UploadRestoreResults(bucket string, backup string, restore string, results io.Reader) error
UploadRestoreResults provides a mock function with given fields: bucket, backup, restore, results
type FakeBackupService ¶
func (*FakeBackupService) DeleteBackup ¶
func (f *FakeBackupService) DeleteBackup(bucket, backupName string) error
func (*FakeBackupService) DownloadBackup ¶
func (f *FakeBackupService) DownloadBackup(bucket, name string) (io.ReadCloser, error)
func (*FakeBackupService) GetAllBackups ¶
func (f *FakeBackupService) GetAllBackups(bucket string) ([]*v1.Backup, error)
func (*FakeBackupService) GetBackup ¶ added in v0.4.0
func (f *FakeBackupService) GetBackup(bucket, name string) (*v1.Backup, error)
func (*FakeBackupService) UploadBackup ¶
func (f *FakeBackupService) UploadBackup(bucket, name string, metadata, backup io.Reader) error
type FakeDiscoveryHelper ¶ added in v0.4.0
type FakeDiscoveryHelper struct { ResourceList []*metav1.APIResourceList Mapper meta.RESTMapper AutoReturnResource bool }
func NewFakeDiscoveryHelper ¶ added in v0.5.0
func NewFakeDiscoveryHelper(autoReturnResource bool, resources map[schema.GroupVersionResource]schema.GroupVersionResource) *FakeDiscoveryHelper
func (*FakeDiscoveryHelper) Refresh ¶ added in v0.4.0
func (dh *FakeDiscoveryHelper) Refresh() error
func (*FakeDiscoveryHelper) ResourceFor ¶ added in v0.5.0
func (dh *FakeDiscoveryHelper) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, metav1.APIResource, error)
func (*FakeDiscoveryHelper) Resources ¶ added in v0.4.0
func (dh *FakeDiscoveryHelper) Resources() []*metav1.APIResourceList
type FakeDynamicClient ¶
func (*FakeDynamicClient) Create ¶
func (c *FakeDynamicClient) Create(obj *unstructured.Unstructured) (*unstructured.Unstructured, error)
func (*FakeDynamicClient) Get ¶ added in v0.5.0
func (c *FakeDynamicClient) Get(name string, opts metav1.GetOptions) (*unstructured.Unstructured, error)
func (*FakeDynamicClient) List ¶
func (c *FakeDynamicClient) List(options metav1.ListOptions) (runtime.Object, error)
func (*FakeDynamicClient) Patch ¶ added in v0.9.0
func (c *FakeDynamicClient) Patch(name string, data []byte) (*unstructured.Unstructured, error)
func (*FakeDynamicClient) Watch ¶
func (c *FakeDynamicClient) Watch(options metav1.ListOptions) (watch.Interface, error)
type FakeDynamicFactory ¶
func (*FakeDynamicFactory) ClientForGroupVersionResource ¶
func (df *FakeDynamicFactory) ClientForGroupVersionResource(gv schema.GroupVersion, resource metav1.APIResource, namespace string) (client.Dynamic, error)
type FakeFileSystem ¶ added in v0.9.0
type FakeFileSystem struct { ReadDirCalls []string // contains filtered or unexported fields }
func NewFakeFileSystem ¶ added in v0.9.0
func NewFakeFileSystem() *FakeFileSystem
func (*FakeFileSystem) Create ¶ added in v0.9.0
func (fs *FakeFileSystem) Create(name string) (io.WriteCloser, error)
func (*FakeFileSystem) DirExists ¶ added in v0.9.0
func (fs *FakeFileSystem) DirExists(path string) (bool, error)
func (*FakeFileSystem) MkdirAll ¶ added in v0.9.0
func (fs *FakeFileSystem) MkdirAll(path string, perm os.FileMode) error
func (*FakeFileSystem) ReadDir ¶ added in v0.9.0
func (fs *FakeFileSystem) ReadDir(dirname string) ([]os.FileInfo, error)
func (*FakeFileSystem) ReadFile ¶ added in v0.9.0
func (fs *FakeFileSystem) ReadFile(filename string) ([]byte, error)
func (*FakeFileSystem) RemoveAll ¶ added in v0.9.0
func (fs *FakeFileSystem) RemoveAll(path string) error
func (*FakeFileSystem) TempDir ¶ added in v0.9.0
func (fs *FakeFileSystem) TempDir(dir, prefix string) (string, error)
func (*FakeFileSystem) WithDirectories ¶ added in v0.9.0
func (fs *FakeFileSystem) WithDirectories(path ...string) *FakeFileSystem
func (*FakeFileSystem) WithDirectory ¶ added in v0.9.0
func (fs *FakeFileSystem) WithDirectory(path string) *FakeFileSystem
func (*FakeFileSystem) WithFile ¶ added in v0.9.0
func (fs *FakeFileSystem) WithFile(path string, data []byte) *FakeFileSystem
type FakeMapper ¶
type FakeMapper struct { meta.RESTMapper AutoReturnResource bool Resources map[schema.GroupVersionResource]schema.GroupVersionResource }
func (*FakeMapper) ResourceFor ¶
func (m *FakeMapper) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
type FakeSnapshotService ¶
type FakeSnapshotService struct { // SnapshotID->VolumeID SnapshotsTaken sets.String // VolumeID -> (SnapshotID, Type, Iops) SnapshottableVolumes map[string]api.VolumeBackupInfo // VolumeBackupInfo -> VolumeID RestorableVolumes map[api.VolumeBackupInfo]string VolumeID string VolumeIDSet string Error error }
func (*FakeSnapshotService) CreateSnapshot ¶
func (*FakeSnapshotService) CreateVolumeFromSnapshot ¶
func (s *FakeSnapshotService) CreateVolumeFromSnapshot(snapshotID, volumeType, volumeAZ string, iops *int64) (string, error)
func (*FakeSnapshotService) DeleteSnapshot ¶
func (s *FakeSnapshotService) DeleteSnapshot(snapshotID string) error
func (*FakeSnapshotService) GetVolumeID ¶ added in v0.6.0
func (s *FakeSnapshotService) GetVolumeID(pv runtime.Unstructured) (string, error)
func (*FakeSnapshotService) GetVolumeInfo ¶
func (s *FakeSnapshotService) GetVolumeInfo(volumeID, volumeAZ string) (string, *int64, error)
func (*FakeSnapshotService) SetVolumeID ¶ added in v0.6.0
func (s *FakeSnapshotService) SetVolumeID(pv runtime.Unstructured, volumeID string) (runtime.Unstructured, error)
type MockPodCommandExecutor ¶ added in v0.9.0
func (*MockPodCommandExecutor) ExecutePodCommand ¶ added in v0.9.0
func (e *MockPodCommandExecutor) ExecutePodCommand(log logrus.FieldLogger, item map[string]interface{}, namespace, name, hookName string, hook *v1.ExecHook) error
type ObjectStore ¶ added in v0.6.0
ObjectStore is an autogenerated mock type for the ObjectStore type
func (*ObjectStore) CreateSignedURL ¶ added in v0.6.0
func (_m *ObjectStore) CreateSignedURL(bucket string, key string, ttl time.Duration) (string, error)
CreateSignedURL provides a mock function with given fields: bucket, key, ttl
func (*ObjectStore) DeleteObject ¶ added in v0.6.0
func (_m *ObjectStore) DeleteObject(bucket string, key string) error
DeleteObject provides a mock function with given fields: bucket, key
func (*ObjectStore) GetObject ¶ added in v0.6.0
func (_m *ObjectStore) GetObject(bucket string, key string) (io.ReadCloser, error)
GetObject provides a mock function with given fields: bucket, key
func (*ObjectStore) Init ¶ added in v0.6.0
func (_m *ObjectStore) Init(config map[string]string) error
Init provides a mock function with given fields: config
func (*ObjectStore) ListCommonPrefixes ¶ added in v0.6.0
func (_m *ObjectStore) ListCommonPrefixes(bucket string, delimiter string) ([]string, error)
ListCommonPrefixes provides a mock function with given fields: bucket, delimiter
func (*ObjectStore) ListObjects ¶ added in v0.6.0
func (_m *ObjectStore) ListObjects(bucket string, prefix string) ([]string, error)
ListObjects provides a mock function with given fields: bucket, prefix
type TestBackup ¶
func NewTestBackup ¶
func NewTestBackup() *TestBackup
func (*TestBackup) WithDeletionTimestamp ¶ added in v0.7.0
func (b *TestBackup) WithDeletionTimestamp(time time.Time) *TestBackup
func (*TestBackup) WithExcludedNamespaces ¶
func (b *TestBackup) WithExcludedNamespaces(ns ...string) *TestBackup
func (*TestBackup) WithExcludedResources ¶
func (b *TestBackup) WithExcludedResources(r ...string) *TestBackup
func (*TestBackup) WithExpiration ¶
func (b *TestBackup) WithExpiration(expiration time.Time) *TestBackup
func (*TestBackup) WithFinalizers ¶ added in v0.7.0
func (b *TestBackup) WithFinalizers(finalizers ...string) *TestBackup
func (*TestBackup) WithIncludedNamespaces ¶
func (b *TestBackup) WithIncludedNamespaces(ns ...string) *TestBackup
func (*TestBackup) WithIncludedResources ¶
func (b *TestBackup) WithIncludedResources(r ...string) *TestBackup
func (*TestBackup) WithLabel ¶
func (b *TestBackup) WithLabel(key, value string) *TestBackup
func (*TestBackup) WithName ¶
func (b *TestBackup) WithName(name string) *TestBackup
func (*TestBackup) WithNamespace ¶
func (b *TestBackup) WithNamespace(namespace string) *TestBackup
func (*TestBackup) WithPhase ¶
func (b *TestBackup) WithPhase(phase v1.BackupPhase) *TestBackup
func (*TestBackup) WithResourceVersion ¶ added in v0.7.0
func (b *TestBackup) WithResourceVersion(version string) *TestBackup
func (*TestBackup) WithSnapshot ¶
func (b *TestBackup) WithSnapshot(pv string, snapshot string) *TestBackup
func (*TestBackup) WithSnapshotVolumes ¶ added in v0.4.0
func (b *TestBackup) WithSnapshotVolumes(value bool) *TestBackup
func (*TestBackup) WithSnapshotVolumesPointer ¶ added in v0.4.0
func (b *TestBackup) WithSnapshotVolumesPointer(value *bool) *TestBackup
func (*TestBackup) WithTTL ¶
func (b *TestBackup) WithTTL(ttl time.Duration) *TestBackup
func (*TestBackup) WithVersion ¶
func (b *TestBackup) WithVersion(version int) *TestBackup
type TestRestore ¶
func NewDefaultTestRestore ¶ added in v0.4.0
func NewDefaultTestRestore() *TestRestore
func NewTestRestore ¶
func NewTestRestore(ns, name string, phase api.RestorePhase) *TestRestore
func (*TestRestore) WithBackup ¶
func (r *TestRestore) WithBackup(name string) *TestRestore
func (*TestRestore) WithErrors ¶
func (r *TestRestore) WithErrors(i int) *TestRestore
func (*TestRestore) WithExcludedNamespace ¶ added in v0.4.0
func (r *TestRestore) WithExcludedNamespace(name string) *TestRestore
func (*TestRestore) WithExcludedResource ¶ added in v0.4.0
func (r *TestRestore) WithExcludedResource(resource string) *TestRestore
func (*TestRestore) WithIncludedNamespace ¶ added in v0.4.0
func (r *TestRestore) WithIncludedNamespace(name string) *TestRestore
func (*TestRestore) WithIncludedResource ¶ added in v0.4.0
func (r *TestRestore) WithIncludedResource(resource string) *TestRestore
func (*TestRestore) WithMappedNamespace ¶ added in v0.4.0
func (r *TestRestore) WithMappedNamespace(from string, to string) *TestRestore
func (*TestRestore) WithRestorePVs ¶ added in v0.4.0
func (r *TestRestore) WithRestorePVs(value bool) *TestRestore
func (*TestRestore) WithValidationError ¶
func (r *TestRestore) WithValidationError(err string) *TestRestore
type TestSchedule ¶
func NewTestSchedule ¶
func NewTestSchedule(namespace, name string) *TestSchedule
func (*TestSchedule) WithCronSchedule ¶
func (s *TestSchedule) WithCronSchedule(cronExpression string) *TestSchedule
func (*TestSchedule) WithLastBackupTime ¶
func (s *TestSchedule) WithLastBackupTime(timeString string) *TestSchedule
func (*TestSchedule) WithPhase ¶
func (s *TestSchedule) WithPhase(phase api.SchedulePhase) *TestSchedule
func (*TestSchedule) WithValidationError ¶
func (s *TestSchedule) WithValidationError(msg string) *TestSchedule