Report image we can't pull and must be built#7052
Conversation
80f49d3 to
f5789da
Compare
| def pull_service(service): | ||
| strm = service.pull(ignore_pull_failures, True, stream=True) | ||
|
|
||
| if strm is None: # Attempting to pull service with no `image` key is a no-op |
There was a problem hiding this comment.
| if strm is None: # Attempting to pull service with no `image` key is a no-op | |
| if not strm: # Attempting to pull service with no `image` key is a no-op |
There was a problem hiding this comment.
was by initial code, but can change this indeed
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
f5789da to
55c5c8e
Compare
|
Hey, thanks for this! I was thinking about it and I just wanted to add a little more context, I know previously I said that just not producing an error in the case of a service with image+build would solve my case (and it does) but I did just want to add that it is kind of a coincidence because my image was named something that doesn't happen to match an image in the docker repository. For example mine is: There is no image in docker hub simply called I'm not sure what the right thing to do there is, but I figured you'd want to consider it. My immediate thought would be to allow local image names to have characters that are illegal for remote images so it could just never pull in this case, such as Anyway thank you and I think this is a good improvement and compromise. |
justinmchase
left a comment
There was a problem hiding this comment.
I'm not a python expert or setup to test it locally but from the perspective of the fix based on previous convo's it looks good.
👍
| service.pull(ignore_pull_failures, silent=silent) | ||
| if len(must_build): | ||
| log.warning('Some service image(s) must be built from source by running:\n' | ||
| ' docker-compose build {}' |
|
there's not such thing as a "local" image. Images are by design built so they can be shared by registries. To avoid collision with a Dockerhub image, you should just always use your own registry names : justinmchase/ambassador of mycompany/ambassador |
|
LGTM |
As we pull images, on
NotFoundbut service has build definition, report required command to build the missing images.Resolves #6464
cc @justinmchase