Skip to content

Commit

Permalink
images/Export: Revert signature change
Browse files Browse the repository at this point in the history
Don't make the `Export` signature more restrictive in a cherry-pick.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
  • Loading branch information
vvoland committed Jan 4, 2024
1 parent 92398ba commit 39da4bc
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions images/archive/exporter.go
Expand Up @@ -218,7 +218,7 @@ type ContentProvider interface {
}

// Export implements Exporter.
func Export(ctx context.Context, store ContentProvider, writer io.Writer, opts ...ExportOpt) error {
func Export(ctx context.Context, store content.Provider, writer io.Writer, opts ...ExportOpt) error {
var eo exportOptions
for _, opt := range opts {
if err := opt(ctx, &eo); err != nil {
Expand All @@ -231,13 +231,17 @@ func Export(ctx context.Context, store ContentProvider, writer io.Writer, opts .
}

manifests := make([]ocispec.Descriptor, 0, len(eo.manifests))
for _, desc := range eo.manifests {
d, err := copySourceLabels(ctx, store, desc)
if err != nil {
log.G(ctx).WithError(err).WithField("desc", desc).Warn("failed to copy distribution.source labels")
continue
if infoProvider, ok := store.(content.InfoProvider); ok {
for _, desc := range eo.manifests {
d, err := copySourceLabels(ctx, infoProvider, desc)
if err != nil {
log.G(ctx).WithError(err).WithField("desc", desc).Warn("failed to copy distribution.source labels")
continue
}
manifests = append(manifests, d)
}
manifests = append(manifests, d)
} else {
manifests = append(manifests, eo.manifests...)
}

algorithms := map[string]struct{}{}
Expand Down

0 comments on commit 39da4bc

Please sign in to comment.