-
Notifications
You must be signed in to change notification settings - Fork 562
Remove the need for remote.CheckPushPermission #412
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
Comments
I had two ideas for this. One is simple, the other requires a few fixes. Simple ideaWe create a registry client package that maps directly to the distribution spec. These would be lower-level operations, not like our higher level People who need the functionality that Complex ideaTL;DR: we need to do everything lazily instead of eagerly. There are a lot of things we need to fix, that could be broken out into separate issues, but lumping them all in here will make it easier to understand the problem end-to-end, I think. What needs fixing, in order:
exampleLet's look at a code snippet from kaniko to see what's wrong and how this would be better: https://github.com/GoogleContainerTools/kaniko/blob/246cc92a33c29d76b811f7da605375d8bc4c2198/pkg/executor/push.go#L110-L144 todayWe open up a layer using After that, we initate a push, which can fail if we don't have valid credentials. tomorrowWhen we open up the layer using We'll immediately start the image upload, which will fail when we try to initiate a blob upload, which happens before we even try to open the layer's Thus, we never even try to open the file. followupMost of the I'm not sure if we can do this without breaking clients, but I think it's worth doing even if it's hard. |
This issue is stale because it has been open for 90 days with no |
This method employs a somewhat silly hack to determine reliably whether a keychain can be used to authorize pushes to a repo. This can be useful if you want to check whether you can push an image before you spend lots of effort constructing the layers for that image.
@jonjohnsonjr has some ideas about how we can make this unnecessary by allowing users to call
remote.Write
before all the layer contents are available andmutate.Append
ed in, by passingstream.Layer
s to it that are populated in goroutines and closed when they're done. This relies on a change to howremote.Write
,mutate.Append
andstream.Layer
fit together.I'll let him elaborate.
The text was updated successfully, but these errors were encountered: