-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Conversation
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>
d2f58ee
to
bc42af9
Compare
result.AttestationInlineOnlyKey: []byte(strconv.FormatBool(true)), | ||
}) | ||
if len(atts) > 0 { | ||
return nil, errors.Errorf("cannot export attestations without multi-platform enabled") |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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".
There was a problem hiding this comment.
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>
Parts of this fix picked up by #3389, the rest of it dropped. |
🍒 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