Use same tags for checkpoints and snapshots (#2165)

## Description

Use same tags for checkpoints and snapshots as having different tags won't get us too much benefit. We can revisit this if we find we're really doing too many manifest fetches, but until then the current code to fetch manifests is pretty good.

## Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x]  No 

## Type of change

- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 💻 CI/Deployment
- [x] 🧹 Tech Debt/Cleanup

## Issue(s)

* #1674 

## Test Plan

<!-- How will this be tested prior to merging.-->
- [x] 💪 Manual
- [ ]  Unit test
- [ ] 💚 E2E
This commit is contained in:
ashmrtn 2023-01-18 14:04:37 -08:00 committed by GitHub
parent 383b93f097
commit 6f67d9744a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 10 deletions

View File

@ -24,9 +24,6 @@ const (
// (permalinks)
// [1] https://github.com/kopia/kopia/blob/05e729a7858a6e86cb48ba29fb53cb6045efce2b/cli/command_snapshot_create.go#L169
userTagPrefix = "tag:"
// Tag key applied to checkpoints (but not completed snapshots) in kopia.
checkpointTagKey = "checkpoint"
)
type Reason struct {

View File

@ -192,12 +192,7 @@ func (w Wrapper) makeSnapshotWithRoot(
snapIDs,
)
checkpointTagK, checkpointTagV := makeTagKV(checkpointTagKey)
tags := map[string]string{}
checkpointTags := map[string]string{
checkpointTagK: checkpointTagV,
}
for k, v := range addlTags {
mk, mv := makeTagKV(k)
@ -207,7 +202,6 @@ func (w Wrapper) makeSnapshotWithRoot(
}
tags[mk] = v
checkpointTags[mk] = v
}
err := repo.WriteSession(
@ -246,7 +240,7 @@ func (w Wrapper) makeSnapshotWithRoot(
u := snapshotfs.NewUploader(rw)
progress.UploadProgress = u.Progress
u.Progress = progress
u.CheckpointLabels = checkpointTags
u.CheckpointLabels = tags
man, err = u.Upload(innerCtx, root, policyTree, si, prevSnaps...)
if err != nil {