Browse Source

c8d/push: Set distribution source recursively

After a successful push, all pushed blobs should have a
distribution.source label pointing to the new registry.

Before this commit, the label was only appended to the top-level blob
(manifest or manifest list). Adjust this to also do that recursively to
its children.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Paweł Gronowski 1 year ago
parent
commit
488559a330
1 changed files with 2 additions and 1 deletions
  1. 2 1
      daemon/containerd/image_push.go

+ 2 - 1
daemon/containerd/image_push.go

@@ -182,7 +182,8 @@ func appendDistributionSourceLabel(ctx context.Context, realStore content.Store,
 		return
 		return
 	}
 	}
 
 
-	if err := containerdimages.Dispatch(ctx, appendSource, nil, target); err != nil {
+	handler := presentChildrenHandler(realStore, appendSource)
+	if err := containerdimages.Dispatch(ctx, handler, nil, target); err != nil {
 		// Shouldn't happen, but even if it would fail, then make it only a warning
 		// Shouldn't happen, but even if it would fail, then make it only a warning
 		// because it doesn't affect the pushed data.
 		// because it doesn't affect the pushed data.
 		log.G(ctx).WithError(err).Warn("failed to append distribution source labels to pushed content")
 		log.G(ctx).WithError(err).Warn("failed to append distribution source labels to pushed content")