-
Notifications
You must be signed in to change notification settings - Fork 642
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
docker:save fails if no images are defined #1185
Comments
Good catch. Fancy to submit a PR ? |
I would, but I'm not sure whether my employer allows open-source contributions without prior approval. I will check though. |
@wrose504 cool. Maybe it helps as an argument, that you are using that open source component for your product and you would like to help to fix it (which then also helps your productised usage). That is how open source works btw. |
…efined. Signed-off-by: William Rose <william.rose@nuance.com>
…efined. Signed-off-by: William Rose <william.rose@nuance.com>
I figured out the company policy and I have created PR #1194 using my other account. I tested it against 0.28.0 as a baseline because the recent changes on master mean the test suite no longer runs cleanly on Windows, but the patch is small and applies cleanly to master. |
Cool, thanks a lot for your support ! Sorry we don't do regular tests on Windows (we should though). Could you please open another issue witht the Windows build problems ? That would be awesome ! |
…efined. Signed-off-by: William Rose <william.rose@nuance.com>
…efined. Signed-off-by: William Rose <william.rose@nuance.com>
…efined. Signed-off-by: William Rose <william.rose@nuance.com>
…efined. Signed-off-by: William Rose <william.rose@nuance.com>
…efined. Signed-off-by: William Rose <william.rose@nuance.com>
* Issue #1185 Prevent docker:save failing when no images are defined. Signed-off-by: William Rose <william.rose@nuance.com> * chore(docker:save): Some refactoring
If the save goal is executed when no images are defined, it fails with a message indicating that multiple images are defined. This occurs because the code checks whether the image list size is exactly one, and does not consider the possibility that the list is empty.
docker-maven-plugin/src/main/java/io/fabric8/maven/docker/SaveMojo.java
Line 104 in 546c7a1
The warning is then emitted just below:
docker-maven-plugin/src/main/java/io/fabric8/maven/docker/SaveMojo.java
Line 107 in 546c7a1
I came across this issue when I bound the docker:save goal to the install phase in a parent pom that defined no images, with the intention of defining images only in child poms. However, this code meant that the parent failed to build.
I was able to work around this with a non-inherited plugin configuration in the parent that set skipSave=true, but it seems like it would be better if the mojo would skip over projects where there were no images without raising an error.
The text was updated successfully, but these errors were encountered: