Skip to content

content.Fetch: better error when auth fails#2052

Merged
dmcgowan merged 1 commit intocontainerd:masterfrom
darstahl:PullDenied
Jan 24, 2018
Merged

content.Fetch: better error when auth fails#2052
dmcgowan merged 1 commit intocontainerd:masterfrom
darstahl:PullDenied

Conversation

@darstahl
Copy link
Copy Markdown
Contributor

I was debugging why I was getting a token auth failure when attempting to pull an image, @jessvalarezo realized that the image was just misspelled.

This adds extra error context when the failure is caused by failed auth to indicate that the repository just might not exist.

PS H:\bin\containerd> .\ctr images pull docker.io/image/doesnotexist:latest
docker.io/image/doesnotexist:latest: resolving      |--------------------------------------|
elapsed: 0.8 s                       total:   0.0 B (0.0 B/s)
ctr: failed to resolve reference "docker.io/image/doesnotexist:latest": pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

cc @stevvooe FYI this was what I thought was a failed token auth. Just a misunderstanding 😄

Signed-off-by: Darren Stahl [email protected]

@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #2052 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2052      +/-   ##
==========================================
+ Coverage   45.42%   45.43%   +0.01%     
==========================================
  Files          96       96              
  Lines        9427     9429       +2     
==========================================
+ Hits         4282     4284       +2     
  Misses       4435     4435              
  Partials      710      710
Flag Coverage Δ
#linux 50.35% <100%> (+0.01%) ⬆️
#windows 40.31% <100%> (+0.01%) ⬆️
Impacted Files Coverage Δ
remotes/docker/resolver.go 59.25% <100%> (+0.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12eaf13...f404331. Read the comment docs.

@stevvooe
Copy link
Copy Markdown
Member

LGTM

@dmcgowan PTAL

@dmcgowan
Copy link
Copy Markdown
Member

LGTM

@dmcgowan dmcgowan merged commit 8d32d9e into containerd:master Jan 24, 2018
jonnystoten added a commit to jonnystoten/containerd that referenced this pull request Jul 27, 2022
For consistency with pulls, see containerd#2052.

Signed-off-by: Jonny Stoten <[email protected]>
kiashok pushed a commit to kiashok/containerd that referenced this pull request Oct 23, 2024
For consistency with pulls, see containerd#2052.

Signed-off-by: Jonny Stoten <[email protected]>
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.

4 participants