|
@@ -176,7 +176,7 @@ func Export(ctx context.Context, store content.Provider, writer io.Writer, opts
|
|
}
|
|
}
|
|
|
|
|
|
name := desc.Annotations[images.AnnotationImageName]
|
|
name := desc.Annotations[images.AnnotationImageName]
|
|
- if name != "" && !eo.skipDockerManifest {
|
|
|
|
|
|
+ if name != "" {
|
|
mt.names = append(mt.names, name)
|
|
mt.names = append(mt.names, name)
|
|
}
|
|
}
|
|
case images.MediaTypeDockerSchema2ManifestList, ocispec.MediaTypeImageIndex:
|
|
case images.MediaTypeDockerSchema2ManifestList, ocispec.MediaTypeImageIndex:
|
|
@@ -215,26 +215,24 @@ func Export(ctx context.Context, store content.Provider, writer io.Writer, opts
|
|
records = append(records, r...)
|
|
records = append(records, r...)
|
|
}
|
|
}
|
|
|
|
|
|
- if !eo.skipDockerManifest {
|
|
|
|
- if len(manifests) >= 1 {
|
|
|
|
- if len(manifests) > 1 {
|
|
|
|
- sort.SliceStable(manifests, func(i, j int) bool {
|
|
|
|
- if manifests[i].Platform == nil {
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
- if manifests[j].Platform == nil {
|
|
|
|
- return true
|
|
|
|
- }
|
|
|
|
- return eo.platform.Less(*manifests[i].Platform, *manifests[j].Platform)
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- d = manifests[0].Digest
|
|
|
|
- dManifests[d] = &exportManifest{
|
|
|
|
- manifest: manifests[0],
|
|
|
|
- }
|
|
|
|
- } else if eo.platform != nil {
|
|
|
|
- return fmt.Errorf("no manifest found for platform: %w", errdefs.ErrNotFound)
|
|
|
|
|
|
+ if len(manifests) >= 1 {
|
|
|
|
+ if len(manifests) > 1 {
|
|
|
|
+ sort.SliceStable(manifests, func(i, j int) bool {
|
|
|
|
+ if manifests[i].Platform == nil {
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ if manifests[j].Platform == nil {
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
|
|
+ return eo.platform.Less(*manifests[i].Platform, *manifests[j].Platform)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ d = manifests[0].Digest
|
|
|
|
+ dManifests[d] = &exportManifest{
|
|
|
|
+ manifest: manifests[0],
|
|
}
|
|
}
|
|
|
|
+ } else if eo.platform != nil {
|
|
|
|
+ return fmt.Errorf("no manifest found for platform: %w", errdefs.ErrNotFound)
|
|
}
|
|
}
|
|
resolvedIndex[desc.Digest] = d
|
|
resolvedIndex[desc.Digest] = d
|
|
}
|
|
}
|
|
@@ -250,7 +248,7 @@ func Export(ctx context.Context, store content.Provider, writer io.Writer, opts
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if len(dManifests) > 0 {
|
|
|
|
|
|
+ if !eo.skipDockerManifest && len(dManifests) > 0 {
|
|
tr, err := manifestsRecord(ctx, store, dManifests)
|
|
tr, err := manifestsRecord(ctx, store, dManifests)
|
|
if err != nil {
|
|
if err != nil {
|
|
return fmt.Errorf("unable to create manifests file: %w", err)
|
|
return fmt.Errorf("unable to create manifests file: %w", err)
|