-
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
Property placeholders are not interpolated when they are the only thing in the XML element value #960
Comments
This sounds like an issue in StrSubstitutor as it is used in docker-maven-plugin/src/main/java/io/fabric8/maven/docker/access/ContainerCreateConfig.java Line 61 in 674e80f
The problem with non interpolation of variables could be the startup order of containers, which is fixed when using a dependency like linking containers, but is random when not. |
Shouldn't |
Both imply an order (as you obviously only can link to a running container), and there are even more implicite depdendencies as you can see in docker-maven-plugin/src/main/java/io/fabric8/maven/docker/config/ImageConfiguration.java Lines 76 to 86 in 4b16f12
|
OK fair enough, makes sense. But I would expect that all the properties for a container be available when only |
Yes, agreed. I think its good enough to have this ticket and fix both issues simultaneously. Unfortunately, I'm quite busy these days, so can't promise when to work on it. @rohanKanojia would this issue something for you to start with? I don't think its overly complicated and relatively clearly defined. Happy to help of course :) |
…hey are only thing in XML Somehow these ${...} parameters are not being picked up by maven properly when used solely without any suffix string literal, the maven parameter string comes off as NULL. So adding a workaround for this. We'll use +${...} as a parameter which would be handled by dmp afterwards
…hey are only thing in XML Somehow these ${...} parameters are not being picked up by maven properly when used solely without any suffix string literal, the maven parameter string comes off as NULL. So adding a workaround for this. We'll use +${...} as a parameter which would be handled by dmp afterwards
…hey are only thing in XML Somehow these ${...} parameters are not being picked up by maven properly when used solely without any suffix string literal, the maven parameter string comes off as NULL. So adding a workaround for this. We'll use +${...} as a parameter which would be handled by dmp afterwards
…hey are only thing in XML Somehow these ${...} parameters are not being picked up by maven properly when used solely without any suffix string literal, the maven parameter string comes off as NULL. So adding a workaround for this. We'll use +${...} as a parameter which would be handled by dmp afterwards
Fixes #960 Property placeholders are not interpolated when they are only thing in XML
Does this also fix the container ordering issue? |
Description
Property interpolation like
${docker.container.<container>.ip}
only seem to work when they are adjacent to other text in the target XML element.From the sample pom.xml:
<CONSUL_HTTP_ADDR>${docker.container.consul.ip}:8500</CONSUL_HTTP_ADDR>
Produces an environment variable of:
CONSUL_HTTP_ADDR=172.17.0.2:8500
However
<CONSUL_HTTP_ADDR>${docker.container.consul.ip}</CONSUL_HTTP_ADDR>
Just by itself produces an environment variable:
CONSUL_HTTP_ADDR=
When one would expect it to just contain:
CONSUL_HTTP_ADDR=172.17.0.2
Also
${docker.container.<container>.ip}
only seems to work when<link>
ed with the container being referenced. If you comment out the<links>
in theconsul-test
image, but leave the<dependsOn>
,${docker.container.consul.ip}
fails to be interpolated even when other text is present in the xml element.Info
mvn -v
) :Sample pom.xml to reproduce the problem
The text was updated successfully, but these errors were encountered: