Add checkpoint and userns gc labels
Prevent checkpoints from getting garbage collected by adding root labels to unreferenced checkpoint objects. Mark checkpoints as gc roots. Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
@@ -567,7 +567,10 @@ func (s *Service) writeContent(ctx context.Context, mediaType, ref string, r io.
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := writer.Commit(ctx, 0, ""); err != nil {
|
||||
labels := map[string]string{
|
||||
"containerd.io/gc.root": time.Now().UTC().Format(time.RFC3339),
|
||||
}
|
||||
if err := writer.Commit(ctx, 0, "", content.WithLabels(labels)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &types.Descriptor{
|
||||
|
||||
Reference in New Issue
Block a user