Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

exporter: filter out inline attestations for docker exporter #3380

Closed
wants to merge 2 commits into from

Conversation

jedevc
Copy link
Member

@jedevc jedevc commented Dec 9, 2022

🍒 Cherry-pick from #3379 since it should be an easy merge.

The docker exporter should filter out inline attestations, since it doesn't support them. Any remaining attestations should cause an error, since they have been requested but cannot actually be output.

Signed-off-by: Justin Chadwell me@jedevc.com

The docker exporter should filter out inline attestations, since it
doesn't support them. Any remaining attestations should cause an error,
since they have been requested but cannot actually be output.

Signed-off-by: Justin Chadwell <me@jedevc.com>
result.AttestationInlineOnlyKey: []byte(strconv.FormatBool(true)),
})
if len(atts) > 0 {
return nil, errors.Errorf("cannot export attestations without multi-platform enabled")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When does this error appear? Doesn't ForceIndex always make result multiplatform when attestations are present?

@@ -77,6 +77,14 @@ func (e *imageExporter) Resolve(ctx context.Context, opt map[string]string) (exp
return nil, err
}

if e.opt.Variant == VariantDocker {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is really correct. This is just mediatypes. Users can export with type=oci and export fine to Docker as well. But I don't have better ideas.

We may need to check in buildx that "docker is multi-platform capable" or "direct push to registry" and only then add "inline-only".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buildx is a possibility, agreed. Not sure though, I have the feeling that that could provide for really tricky results for if we support multiple exporters (#2760).

Could we take the approach from #3389 (comment) and never use inline attestations to change from exporting from a manifest to an index? Though, for simple cases, that means we wouldn't get the provenance.

…form case

Signed-off-by: Justin Chadwell <me@jedevc.com>
@jedevc
Copy link
Member Author

jedevc commented Dec 13, 2022

Parts of this fix picked up by #3389, the rest of it dropped.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants