cmd/snapshots: add gc.root to created snapshots#2323
Merged
crosbymichael merged 1 commit intocontainerd:masterfrom May 4, 2018
Merged
cmd/snapshots: add gc.root to created snapshots#2323crosbymichael merged 1 commit intocontainerd:masterfrom
crosbymichael merged 1 commit intocontainerd:masterfrom
Conversation
This adds gc.root label to snapshots created with prepare and commit via the CLI. WIthout this, created snapshots get immediately garbage collected. There may be a better solution but this seems to be a solid stop gap. We may also need to add more functionality around snapshot labeling for the CLI but current use cases are unclear. Signed-off-by: Stephen J Day <[email protected]>
AkihiroSuda
reviewed
May 3, 2018
| snapshotter := client.SnapshotService(context.GlobalString("snapshotter")) | ||
| mounts, err := snapshotter.Prepare(ctx, key, parent) | ||
| labels := map[string]string{ | ||
| "containerd.io/gc.root": time.Now().UTC().Format(time.RFC3339), |
Member
There was a problem hiding this comment.
Can we have constant (with godoc)?
Probably separate PR though.
Member
|
LGTM |
Codecov Report
@@ Coverage Diff @@
## master #2323 +/- ##
=======================================
Coverage 45.41% 45.41%
=======================================
Files 83 83
Lines 9210 9210
=======================================
Hits 4183 4183
Misses 4351 4351
Partials 676 676
Continue to review full report at Codecov.
|
Member
|
LGTM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds gc.root label to snapshots created with prepare and commit via
the CLI. WIthout this, created snapshots get immediately garbage
collected. There may be a better solution but this seems to be a solid
stop gap.
We may also need to add more functionality around snapshot labeling for
the CLI but current use cases are unclear.
Signed-off-by: Stephen J Day [email protected]