Skip to content

chore(ux): show registry error and hint for dockehub#1222

Merged
qweeah merged 46 commits into
oras-project:mainfrom
qweeah:docker-error
Jan 16, 2024
Merged

chore(ux): show registry error and hint for dockehub#1222
qweeah merged 46 commits into
oras-project:mainfrom
qweeah:docker-error

Conversation

@qweeah

@qweeah qweeah commented Dec 28, 2023

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
This PR

  1. adds prefix to errors returned by registry. E.g. invalid creds for fetching a manifest
$ oras manifest fetch-config localhost:7000/repo:tag -u hello -p 123 >>
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Error response from registry: unauthorized: authentication required
  1. gives recommendation if namespace is missing in a Dockerhub reference.
$ oras pull docker.io/apline:latest
Error response from registry: failed to resolve latest: unauthorized: authentication required: [map[Action:pull Class: Name:apline Type:repository]]
Namespace is missing, do you mean `oras pull docker.io/library/apline:latest`?

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1216

Please check the following list:

  • Does the affected code have corresponding tests, e.g. unit test, E2E test?
  • Does this change require a documentation update?
  • Does this introduce breaking changes that would require an announcement or bumping the major version?
  • Do all new files have an appropriate license header?

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@qweeah qweeah marked this pull request as draft December 28, 2023 08:15
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@codecov

codecov Bot commented Dec 29, 2023

Copy link
Copy Markdown

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (04f0c33) 80.65% compared to head (e602b89) 81.03%.

Files Patch % Lines
cmd/oras/internal/errors/errors.go 90.90% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1222      +/-   ##
==========================================
+ Coverage   80.65%   81.03%   +0.37%     
==========================================
  Files          67       67              
  Lines        3644     3727      +83     
==========================================
+ Hits         2939     3020      +81     
- Misses        493      496       +3     
+ Partials      212      211       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
qweeah added 3 commits January 8, 2024 03:23
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@qweeah qweeah marked this pull request as ready for review January 8, 2024 04:03
Comment thread cmd/oras/internal/errors/errors.go Outdated
Comment thread cmd/oras/internal/errors/errors.go Outdated
Comment thread cmd/oras/internal/option/remote.go Outdated
qweeah added 3 commits January 9, 2024 03:38
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Comment thread cmd/oras/internal/errors/errors.go Outdated
Comment thread cmd/oras/internal/errors/errors.go Outdated
Comment thread cmd/oras/internal/errors/errors.go Outdated
Comment thread cmd/oras/internal/errors/errors.go Outdated
Comment thread cmd/oras/internal/option/remote.go Outdated
Comment thread cmd/oras/internal/errors/errors.go Outdated
Comment thread cmd/oras/internal/option/target.go Outdated
qweeah added 13 commits January 9, 2024 15:24
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>

@shizhMSFT shizhMSFT left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with suggestions

Comment thread cmd/oras/internal/errors/errors.go Outdated
Comment thread cmd/oras/internal/option/target.go Outdated
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@qweeah qweeah merged commit 5bb6c76 into oras-project:main Jan 16, 2024
FeynmanZhou pushed a commit to FeynmanZhou/oras that referenced this pull request May 11, 2024
)

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Feynman Zhou <feynmanzhou@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improve error message when namespace is not specified in the reference of Dockerhub artifacts

2 participants