-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix slave provisioning errors #267
Fix slave provisioning errors #267
Conversation
yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/commons/DockerPullImage.java
Outdated
Show resolved
Hide resolved
yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/commons/DockerPullImage.java
Outdated
Show resolved
Hide resolved
yet-another-docker-plugin/src/main/java/com/github/kostyasha/yad/commons/DockerPullImage.java
Outdated
Show resolved
Hide resolved
@@ -199,17 +198,9 @@ protected boolean shouldPullImage(DockerClient client, String imageName) { | |||
return false; | |||
} | |||
|
|||
List<Image> images = client.listImagesCmd().exec(); | |||
List<Image> images = client.listImagesCmd().withImageNameFilter(fullImageName).exec(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now it's missing docker.io
prefix check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really useful to check that ? Doing it will force to inspect all images without filtering which will crash with the 1MB (or 3MB) output exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When i were initially implementing docker had this prefix for images, without it image search didn't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I not sure how filter works, it happens on daemon side, maybe it's dealing with this nuance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, here you can have filter (i hope it returns images with docker.io and without), but on results list you may not remove check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 127.0.0.1:2374:2374 bobrik/socat TCP-LISTEN:2374,fork UNIX-CONNECT:/var/run/docker.sock
3945abd2b12dd549e30e285bebd0553223b84f58f1919e8af9dbac9c45185dda
$ docker pull docker.io/nginx:latest
latest: Pulling from library/nginx
0a4690c5d889: Pull complete
9719afee3eb7: Pull complete
44446b456159: Pull complete
Digest: sha256:b4b9b3eee194703fc2fa8afa5b7510c77ae70cfba567af1376a573a967c03dbb
Status: Downloaded newer image for nginx:latest
Though http://127.0.0.1:2374/v1.16/images/json
doesn't show prefix. Probably prefix appears when daemon has private registry images.
This PR attempts to fix the problem of slave provisioning errors on a swarm cluster with a lot of images and/or containers.
Instead of inspecting all existing cluster resources, a docker tag and filter are used to list only the needed resources.
Issue: #249 + docker-java/docker-java#977