GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing github.com — fix: create container with a non-existing volume driver triggers docker pull by thaJeztah · Pull Request #48773 · moby/moby Conversation
|
|
Hm, yeah, maybe; there's unfortunately multiple code paths I found that lead to this, and I was trying to find a central location to handle it. I can have a look how bad it is to put it in the other locations. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Hmm.. that said, looking at the docker-py test I'm wondering if we're returning the wrong status for volume create as well. At least a 404 doesn't seem right to me, and a 400 seems more correct for a driver that's not supported; https://github.com/docker/docker-py/blob/a8bac8822127a8f446893a4e7e60d4b5149333bf/tests/integration/api_volume_test.py#L19-L23 def test_create_volume_invalid_driver(self): driver_name = 'invalid.driver' with pytest.raises(docker.errors.NotFound): self.client.create_volume('perfectcherryblossom', driver_name)
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…er pull
The docker CLI uses a "not found" (404) response on `docker create` and `docker run`
as indication that the specified image doesn't exist. Currently, specifying a
volume-driver that is not found also returns a "not found" error, resulting in
the image to be pulled, even if it already exists.
To reproduce:
Pull the image to make sure it's present;
docker pull busybox
Using default tag: latest
latest: Pulling from library/busybox
Digest: sha256:768e5c6f5cb6db0794eec98dc7a967f40631746c32232b78a3105fb946f3ab83
Status: Image is up to date for busybox:latest
docker.io/library/busybox:latest
Before this patch, an image pull was triggered;
docker run --rm --volume-driver nosuchdriver -v /something busybox
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
Digest: sha256:768e5c6f5cb6db0794eec98dc7a967f40631746c32232b78a3105fb946f3ab83
Status: Image is up to date for busybox:latest
docker: Error response from daemon: create 0f4f0e066f5e10b5de0fd794e4e28dc7b5e496d68af291df6c6204a06fbe1599: error looking up volume plugin nosuchdriver: plugin "nosuchdriver" not found.
See 'docker run --help'.
Same, but using the `--mount` flag;
docker run --rm --mount=type=volume,volume-driver=nosuchdriver,target=/something busybox
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
Digest: sha256:768e5c6f5cb6db0794eec98dc7a967f40631746c32232b78a3105fb946f3ab83
Status: Image is up to date for busybox:latest
docker: Error response from daemon: create e80e831b8e1db83febdc4af534d33607face62d8e661de1eeb3ed8b7d4ab5c47: error looking up volume plugin nosuchdriver: plugin "nosuchdriver" not found.
See 'docker run --help'.
After this patch, no pull happens, and the error is returned about the missing
driver;
docker run --rm --volume-driver nosuchdriver -v /something busybox
docker: Error response from daemon: create 21890da7f789fa4e8ce3864284b4c62c3e387373c44c35238048d4e05d17999e: error looking up volume plugin something: plugin "nosuchdriver" not found.
See 'docker run --help'.
docker run --rm --mount=type=volume,volume-driver=nosuchdriver,target=/something busybox
docker: Error response from daemon: create 21890da7f789fa4e8ce3864284b4c62c3e387373c44c35238048d4e05d17999e: error looking up volume plugin something: plugin "nosuchdriver" not found.
See 'docker run --help'.
Signed-off-by: Sebastiaan van Stijn <[email protected]>
The error was duplicating the name of the plugin, showing it twice;
Before this patch:
Error response from daemon: create new-volume: error looking up volume plugin this-plugin-does-not-exist: plugin "this-plugin-does-not-exist" not found
After this patch:
Error response from daemon: create new-volume: error looking up volume plugin: plugin "this-plugin-does-not-exist" not found
Signed-off-by: Sebastiaan van Stijn <[email protected]>
We already checked whether driverName was empty above, in which case we try if there's a driver providing the volume and return early. We only need to set the default driver if no volume was found in that branch so let's move this code there. Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
e1b3098 to
c3fc2f9
Compare
Requested changes must be addressed to merge this pull request.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
creating a container with a non-existing volume driver triggers a docker pull
There was an error while loading. Please reload this page.