-
Notifications
You must be signed in to change notification settings - Fork 180
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
Using ORAS from snap can't authenticate with gcloud credential helper #1079
Using ORAS from snap can't authenticate with gcloud credential helper #1079
Comments
Can you attach the debug log of failed oras push? You can get that with --debug flag set. |
Here's the debug log, overall not the most helpful. I've redacted some URLs with [...]
The only difference on a successful debug log is that the second request has an additional header
The debug logs don't show how it gets this header |
Thank @jteichroeb-oanda The logs at least show snap build doesn't pick up the stored creds from credHelper. |
@jteichroeb-oanda Just to confirm when you using downloaded oras binary and it succeeds, is it |
@qweeah both 1.0.0 and 1.0.1 work. I can't try 1.0.1 with snap since the lastest I see is 1.0.0. |
Got it, taking a look. Thanks for the input. @jteichroeb-oanda |
Upgrading the ORAS installer to v1.0.1 on Snap is still in WIP and tracked in #965 . |
@jteichroeb-oanda snap apps uses separated config file. You should add cred helper to the docker config in snap's virtual environment |
@qweeah that doesn't quite work either, it doesn't have a way to call the credential helper:
|
Looks like the credential helper needss to be accessible within the snap sandbox. I tried
@FeynmanZhou Maybe we should suggest user not to use snap release if they are using credstore or credhelpers, or even remove snap from the installation guide. |
Snap or Snappy is a package management system in Ubuntu with applications containerized and sandboxed. Since a snap application runs in a sandbox environment, snap version of Note The home folder of the snap version of oras is |
One thing that confuses me, I have the gcloud command installed from snap as well, if it can access files outside of the sandbox environment, can't oras do the same thing? |
BTW, the error message docker-credential-gcloud resolves to executable in current directory (./docker-credential-gcloud) of |
Currently, Line 20 in 999ac38
I'm not sure if setting confinement level to Another thing we can try is the snap interfaces, mounting |
Oh. The $ snap connections oras
Interface Plug Slot Notes
home oras:home :home -
network oras:network :network - |
can it's been link to this ? https://forum.snapcraft.io/t/kubectl-wrong-gcloud-path-when-doing-any-operations/18848 i'm checking with other people to know the issue |
Normally, with this interface, the snap will work: https://snapcraft.io/docs/personal-files-interface , I will update the snapcraft.yaml file and let's you test it. |
@SamirPS I don't think using the personal file interface will be a good solution since user might use any config file via |
Tried building a snapcraft version locally with confinement level set to |
thanks for the head up, i let you do the PR and publish it then :) |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Putting it to future milestone to avoid being flagged as stale. To resolve issue here, we tried to convert oras a classic snap app and it's pending snapcraft's approval, see https://forum.snapcraft.io/t/request-for-classic-confinement-oras-and-oras-test/36826 |
What happened in your environment?
I'm using oras like this:
oras push us-central1-docker.pkg.dev/... file.tar.gz
I have docker configured to use gcloud auth using this command:
gcloud auth configure-docker us-central1-docker.pkg.dev
which sets up the ~/.docker/config.json like so:
If I use oras from snap, authentication fails, but if I use the downloaded oras binary it works fine
What did you expect to happen?
Authentication doesn't depend on
How can we reproduce it?
Since this requires authenticating with google cloud platform, replicating my setup isn't the easiest. I can help someone setup a similar environment if necessary
What is the version of your ORAS CLI?
1.0.0, which is the latest version in snap
What is your OS environment?
Ubuntu 20.04
Are you willing to submit PRs to fix it?
The text was updated successfully, but these errors were encountered: