diff options
author | James Liu <jliu@gitlab.com> | 2023-12-12 06:54:25 +0300 |
---|---|---|
committer | James Liu <jliu@gitlab.com> | 2024-01-15 05:40:54 +0300 |
commit | ada54fc25380ad5b6844f46df793a62075b4bb31 (patch) | |
tree | 64aaf7b2a38d7b10f424ca066b4e1a70d82cdac1 /internal/backup/pipeline_test.go | |
parent | 95bbcbcca4a2f344a171dba71f30071850f0fba6 (diff) |
backup: Add RemoveRepository to the strategy
Adds a new method to the Strategy interface used by regular and
server-side backups for performing repository backups and restores. This
new method removes a single repository from its storage, and will
eventually replace the existing RemoveAllRepositories method.
Diffstat (limited to 'internal/backup/pipeline_test.go')
-rw-r--r-- | internal/backup/pipeline_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/internal/backup/pipeline_test.go b/internal/backup/pipeline_test.go index 8545c905e..cd77fb5a7 100644 --- a/internal/backup/pipeline_test.go +++ b/internal/backup/pipeline_test.go @@ -125,6 +125,7 @@ type MockStrategy struct { CreateFunc func(context.Context, *CreateRequest) error RestoreFunc func(context.Context, *RestoreRequest) error RemoveAllRepositoriesFunc func(context.Context, *RemoveAllRepositoriesRequest) error + RemoveRepositoryFunc func(context.Context, *RemoveRepositoryRequest) error } func (s MockStrategy) Create(ctx context.Context, req *CreateRequest) error { @@ -148,6 +149,13 @@ func (s MockStrategy) RemoveAllRepositories(ctx context.Context, req *RemoveAllR return nil } +func (s MockStrategy) RemoveRepository(ctx context.Context, req *RemoveRepositoryRequest) error { + if s.RemoveRepositoryFunc != nil { + return s.RemoveRepositoryFunc(ctx, req) + } + return nil +} + func testPipeline(t *testing.T, init func() *Pipeline) { strategy := MockStrategy{ CreateFunc: func(_ context.Context, req *CreateRequest) error { |