Make the Nerdctl dockerresolver module happy. #2745
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2689
If a user is logged in, but there's no auths["https://index.docker.io/v1/"]
entry in the root's
.docker/config.json
file, the docker-resolvercode will get confused.
So here's how to get into the state that this change fixes:
Without this change, you'll see an error along the lines of
With this change, nerdctl should proceed as usual.
Note that with no
auths
field in/root/.docker/config.json
, runningdocker login
doesn't add it, but runningnerdctl login
does.And if the user is logged out when the code is run,
nerdctl logout
changes the field to
auths: {}
, but the behavior is the same forlogged out users, whether auths is empty or has an entry for
index.docker.io.
The real error here is that when a
configsStore
field is given in.docker/config.json
, theauths
field should be ignored. Docker isignoring it, nerdctl isn't.
Upstream issue: github.com/containerd/nerdctl/pull/1315 with
PR 1315, but some integration tests are failing (looks like due to
flakes) and I don't see a straightforward way to provide unit tests.
Signed-off-by: Eric Promislow epromislow@suse.com