Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the Nerdctl dockerresolver module happy.
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-resolver code will get confused. So here's how to get into the state that this change fixes: * Factory-reset or create a clean state * Start up RD in docker mode (with k8s off to speed things up) * docker login * Switch to containerd * nerdctl pull busybox Without this change, you'll see an error along the lines of FATA[0000] expected ac.ServerAddress ("") to be "https://index.docker.io/v1/" With this change, nerdctl should proceed as usual. Note that with no `auths` field in `/root/.docker/config.json`, running `docker login` doesn't add it, but running `nerdctl 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 for logged 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`, the `auths` field should be ignored. Docker is ignoring 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>
- Loading branch information