Skip to content

Conversation

@cpuguy83
Copy link
Member

@cpuguy83 cpuguy83 commented Dec 6, 2022

Before this required a full content.Store so that it could annotate distribution sources.
With this change PushContent can be used with just a content.Provider. If the content.Provider is also a content.Manager then distribution sources will be updated accordingly.

This allows people to use this function with a significantly implementation.


I was trying to use remotes.PushContent to implement push directly from an OCI tarball only to realize this wants the full content.Store which I had no interest in implementing for a read-only tarball.

Before this required a full content.Store so that it could annotate
distribution sources.
With this change PushContent can be used with just a content.Provider.
If the content.Provider is also a content.Manager then distribution
sources will be updated accordingly.

This allows people to use this function with a significantly
implementation.

Signed-off-by: Brian Goff <[email protected]>
@cpuguy83 cpuguy83 requested a review from fuweid December 6, 2022 17:34
Copy link
Member

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

LGTM

I don't expect this to be a backwards compatibility problem since Provider is a subset interface of Store

platformFilterhandler := images.FilterPlatforms(images.ChildrenHandler(store), platform)

annotateHandler := annotateDistributionSourceHandler(platformFilterhandler, store)
var handler images.Handler
Copy link
Member

Choose a reason for hiding this comment

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

This could be cleaner if it just overwrote the same handler variable and var handler images.handler only needs a single path like before.

@fuweid fuweid merged commit 0fa51f5 into containerd:main Dec 7, 2022
@thaJeztah thaJeztah added the cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch label Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/1.6.x PR commits are cherry-picked into release/1.6 branch

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants