-
Notifications
You must be signed in to change notification settings - Fork 546
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
Conversation
Signed-off-by: Dennis Leon <[email protected]>
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 What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
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.
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.
pkg/v1/remote/options.go
Outdated
// non-distributable (foreign) layers | ||
// | ||
// The default behaviour is not to include them. | ||
func WithIncludeNondistributable() Option { |
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.
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?
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.
+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. 😄
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.
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.
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 defer to Jon, remote.WithNondistributable
(no ()
) sgtm
* Also update the docstring
@googlebot I signed it! |
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.
LGTM, thanks!
Implements #741