Skip to content

Commit

Permalink
exporter: explicitly error if index annotations attempted for manifes…
Browse files Browse the repository at this point in the history
…t export

Signed-off-by: Justin Chadwell <me@jedevc.com>
  • Loading branch information
jedevc committed Nov 14, 2022
1 parent d3f26c6 commit c748ec5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion exporter/containerimage/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@ func (ic *ImageWriter) Commit(ctx context.Context, inp *exporter.Source, session
}
}

mfstDesc, configDesc, err := ic.commitDistributionManifest(ctx, opts, inp.Ref, inp.Metadata[exptypes.ExporterImageConfigKey], &remotes[0], opts.Annotations.Platform(nil), inp.Metadata[exptypes.ExporterInlineCache], dtbi, opts.Epoch, session.NewGroup(sessionID))
annotations := opts.Annotations.Platform(nil)
if annotations.Index != nil || annotations.IndexDescriptor != nil {
return nil, errors.Errorf("index annotations not supported for single platform export")
}

mfstDesc, configDesc, err := ic.commitDistributionManifest(ctx, opts, inp.Ref, inp.Metadata[exptypes.ExporterImageConfigKey], &remotes[0], annotations, inp.Metadata[exptypes.ExporterInlineCache], dtbi, opts.Epoch, session.NewGroup(sessionID))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit c748ec5

Please sign in to comment.