Move containerd media type warnings for attestations#3865
Move containerd media type warnings for attestations#3865jedevc merged 2 commits intomoby:masterfrom
Conversation
| } | ||
|
|
||
| if err := images.Dispatch(ctx, images.Handlers(handlers...), nil, desc); err != nil { | ||
| ctx2 := remotes.WithMediaTypeKeyPrefix(ctx, intoto.PayloadType, "intoto") |
There was a problem hiding this comment.
Although you want to be precise is here and only change the context where it is needed it is better if this is always the first line of the function because the call is not specific to "intoto" at all. Also add a comment where this is used that this registers types that are not defined by default. Otherwise this reads like push.Push() or contentutil.Copy always register current payloadtype as "intoto".
Maybe this is better in a util pkg function, eg. RegisterContentPayloadTypes()
There was a problem hiding this comment.
Although you want to be precise is here and only change the context where it is needed it is better if this is always the first line of the function because the call is not specific to "intoto" at all
Makes sense, it's a lot cleaner all at the top 😄
Maybe this is better in a util pkg function, eg. RegisterContentPayloadTypes()
Agreed, have moved this to contentutil.RegisterContentPayloadTypes().
We were using a mixture of own custom const and the vendored const. For consistency, we should use only the vendored const everywhere. Signed-off-by: Justin Chadwell <me@jedevc.com>
bd3b585 to
74b1d9f
Compare
This moves the containerd suppressions for media type warnings from the exporter package into the push and copy packages which allow them to be used by all lower-level buildkit utilities, e.g. tests. Signed-off-by: Justin Chadwell <me@jedevc.com>
74b1d9f to
86d89ac
Compare
⬆️ Follow-up to #3063
This moves the containerd suppressions for media type warnings from the
exporter package into the push and copy packages which allow them to be
used by all lower-level buildkit utilities, e.g. tests:
buildkit/util/testutil/integration/run.go
Lines 256 to 258 in 81d19ad
Previously, this would cause containerd media type warnings to be printed in test logs if an image with attestations was copied into the local image cache.
While working on this, I also noticed that we can remove our custom definition of the
application/vnd.in-toto+jsonmedia type and replace it withintoto.PayloadType(which we were already using in some places, but inconsistently).