-
Notifications
You must be signed in to change notification settings - Fork 183
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
When I execute an oras push, the scope that calls the get service token loses the push, only the pull #1599
Comments
What is the failure message? What is the registry? Does it always succeed with --debug and always fail without? |
yes, it always succeed with --debug,and always fail without。the registry is a custom registry base on harbor. we add some validate when client gets service token . |
when i push something to a project which the registry is not contain in that project, it will be fail .because there are any valiations in get service token,other client like docker or ctr ,they will add pull and push in scope. but when oras do these,it only add pull |
Based on your proposed fix, I would think it would work if you specified |
Hi @hopegi, could you share a complete debug log of |
did you mean |
oras version is 1.2.0,1.2.2 also appera this problem. i show you the debug's log,but it is not easy to found the problem of the code i think. to releate the pr,
|
Thanks @hopegi for the information. This is indeed a bug. The root cause is that, when tty is used, Lines 211 to 235 in 677529b
oras/internal/registryutil/auth.go Lines 25 to 31 in 677529b
The same issue exists in the main branch too. |
One possible fix could be to pass the repo reference to |
What happened in your environment?
oras push xxx/xxx/test:v1 test.txt
,then i got a fail msg . but i add the--debug
flag ,likeoras push xxx/xxx/test:v1 test.txt --debug
. it push successfully.oras push xxx/xxx/test:v1 test.txt
, the url of calling get service token like thishttps://127.0.0.1/service/token?service=hg-registry&scope=repository%3Ahg-ns1%2Ftest%3Apull
and when i exec cmdoras push xxx/xxx/test:v1 test.txt --debug
,the url ishttps://127.0.0.1/service/token?service=hg-registry&scope=repository%3Ahg-ns1%2Ftest%3Apush%2Cpull
there is something diff between within
--debug
and without--debug
What did you expect to happen?
No response
How can we reproduce it?
just exec the command and catch access log
What is the version of your ORAS CLI?
from 1.2.0 to latest 1.2.2 also has this problem
What is your OS environment?
every linux system
Are you willing to submit PRs to fix it?
The text was updated successfully, but these errors were encountered: