From 30b86f664eb7f0bc045cbf20c70157f98cb40d17 Mon Sep 17 00:00:00 2001 From: ryanfkeepers Date: Tue, 11 Apr 2023 14:54:29 -0600 Subject: [PATCH] tag a union of reason and fallback reasons --- src/internal/operations/backup.go | 8 +++++--- src/internal/operations/backup_test.go | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index 0236c1c12..34cb53984 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -6,6 +6,7 @@ import ( "github.com/alcionai/clues" "github.com/google/uuid" + "golang.org/x/exp/slices" "github.com/alcionai/corso/src/internal/common" "github.com/alcionai/corso/src/internal/common/crash" @@ -269,7 +270,7 @@ func (op *BackupOperation) do( ctx, op.kopia, op.account.ID(), - reasons, + reasons, fallbackReasons, mans, cs, excludes, @@ -405,7 +406,7 @@ func consumeBackupCollections( ctx context.Context, bc inject.BackupConsumer, tenantID string, - reasons []kopia.Reason, + reasons, fallbackReasons []kopia.Reason, mans []*kopia.ManifestEntry, cs []data.BackupCollection, excludes map[string]map[string]struct{}, @@ -425,7 +426,8 @@ func consumeBackupCollections( kopia.TagBackupCategory: "", } - for _, reason := range reasons { + reunion := append(slices.Clone(reasons), fallbackReasons...) + for _, reason := range reunion { for _, k := range reason.TagKeys() { tags[k] = "" } diff --git a/src/internal/operations/backup_test.go b/src/internal/operations/backup_test.go index d8aa99163..b923a8e48 100644 --- a/src/internal/operations/backup_test.go +++ b/src/internal/operations/backup_test.go @@ -577,7 +577,7 @@ func (suite *BackupOpUnitSuite) TestBackupOperation_ConsumeBackupDataCollections ctx, mbu, tenant, - nil, + nil, nil, test.inputMan, nil, nil,