-
Notifications
You must be signed in to change notification settings - Fork 2
Fails to pull a public image from: ghcr.io/matejvasek/builder-ubi8-base:latest #30
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
It appears the the python client does not obtain token the same way Go client do. |
package main
import (
"fmt"
"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/remote"
)
func main() {
img, err := remote.Image(name.MustParseReference("ghcr.io/matejvasek/builder-ubi8-base"))
if err != nil {
panic(err)
}
fmt.Println(img)
} "just works" |
Yep. We should update the code to get a token when we access ghcr.io packages
|
Achieving the same level of code as this one will take time but nevertheless it can help the folks interested to develop/maintain this python registry container - https://github.com/google/go-containerregistry/tree/main/pkg/v1/remote/transport ;-) |
Thanks @cmoulliard, there is probably a gap here. Right now I have implemented the CNCF specification for client logic involving a container image registry with a remote "token auth" server
I do see there is another page in the spec on Oauth2 but I'm not sure at first glance if that's what you're doing above, I only see one token being fetched above, not a refresh token to then generate an access token. |
@cmoulliard Is there any chance you're still dealing with this issue: There is some probing we can do to confirm this, but my current understanding is that it's probably skipping past the whole auth dance in this if statement containerimage-py/image/client.py Lines 308 to 322 in a4cfa50
There are a few possibilities here that could cause this
|
@cmoulliard Ok I see the issue now that I've gone through it once locally - I only ever do the auth dance when basic auth creds are found. I assume that auth is only ever relevant when you as a user attempt to basic auth into the registry and that fails. I just need to remove that condition (whether the basic auth creds were found in your auth dict) from the if statement around the auth dance and this should work. That way we at least try the auth dance any time we get a 401 with |
@cmoulliard I removed the
I think this currently fails because the manifest list is an OCI index but the arch manifest entries are all docker v2s2 and I strictly expect OCI manifests if I get an OCI index, and vice versa for Docker v2. That might be too heavy handed of a check on my end |
@cmoulliard @matejvasek Can you review this PR for me? This should fix your initial issue (well, not in its entirety as mentioned above, but we can hash that out in a separate issue) |
Moved into review. The fix is merged into main & release-1.0. Will leave in review until we have a |
@cmoulliard @matejvasek This PR should unblock you guys, please take a look when you get the chance It is tracked under this separate issue I will get this into the |
Going to go ahead and merge that PR now |
Issue
I can pull an image using
podman pull ghcr.io/matejvasek/builder-ubi8-base
fromghcr.io
registry but that fails using this python libThe text was updated successfully, but these errors were encountered: