Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2108,6 +2108,7 @@ func testBuildExportScratch(t *testing.T, sb integration.Sandbox) {
Attrs: map[string]string{
"name": target,
"push": "true",
"unpack": "true",
"compression": "uncompressed",
},
},
Expand Down
18 changes: 9 additions & 9 deletions exporter/containerimage/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func (e *imageExporterInstance) Export(ctx context.Context, src *exporter.Source
}
tagDone(nil)

if src.Ref != nil && e.unpack {
if e.unpack {
if err := e.unpackImage(ctx, img, src, session.NewGroup(sessionID)); err != nil {
return nil, nil, err
}
Expand Down Expand Up @@ -366,16 +366,16 @@ func (e *imageExporterInstance) unpackImage(ctx context.Context, img images.Imag
return err
}

topLayerRef := src.Ref
if len(src.Refs) > 0 {
if r, ok := src.Refs[defaultPlatform()]; ok {
topLayerRef = r
} else {
return errors.Errorf("no reference for default platform %s", defaultPlatform())
}
ref, ok := src.FindRef(defaultPlatform())
if !ok {
return errors.Errorf("no reference for default platform %s", defaultPlatform())
}
if ref == nil {
// ref has no layers, so nothing to unpack
return nil
}

remotes, err := topLayerRef.GetRemotes(ctx, true, e.opts.RefCfg, false, s)
remotes, err := ref.GetRemotes(ctx, true, e.opts.RefCfg, false, s)
if err != nil {
return err
}
Expand Down