Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Support non-distributable layers in Write and MultiWrite #930

Merged
merged 3 commits into from
Feb 5, 2021
Merged

Support non-distributable layers in Write and MultiWrite #930

merged 3 commits into from
Feb 5, 2021

Conversation

StevenLocke
Copy link
Contributor

Implements #741

Signed-off-by: Dennis Leon <leonde@vmware.com>
@google-cla
Copy link

google-cla bot commented Feb 4, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

Copy link
Collaborator

@jonjohnsonjr jonjohnsonjr left a comment

Choose a reason for hiding this comment

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

Neat, thanks! Once CLA is sorted out this looks pretty good.

I'll want to expose this option in pkg/crane and as a flag for --crane, but I can do that later myself.

// non-distributable (foreign) layers
//
// The default behaviour is not to include them.
func WithIncludeNondistributable() Option {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a mouthful, but I don't have a better suggestion. Maybe WithNondistributable is good enough?

This could also take a bool if we want WithNondistributable(false) to work as an explicit "don't push these" option, to override any other options.

If that doesn't seem plausible, we can drop the thunk if this will only ever be true.

cc @imjasonh bikeshed naming here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1 to WithNonDistributable and a clear docstring. If we find a better alternative we can deprecate this and call it something else later.

Also +1 to making it only true-able, and not make people think about what WithNonDistributable(false) means. 😄

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also +1 to making it only true-able, and not make people think about what WithNonDistributable(false) means. 😄

I was suggesting the opposite actually, but I'm open to being convinced.

The point I was trying to make is that if we do decide only true-able, I'd rather see:

foo(bar, remote.WithNondistributable)

than

foo(bar, remote.WithNondistributable())

WithNonDistributable

I'm gonna be super pedantic here but I think lowercasing the D matches the media type better, if we go with this, so:

WithNondistributable is my preference.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I defer to Jon, remote.WithNondistributable (no ()) sgtm

@StevenLocke
Copy link
Contributor Author

@googlebot I signed it!

Copy link
Collaborator

@jonjohnsonjr jonjohnsonjr left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

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

Successfully merging this pull request may close these issues.

None yet

3 participants