Skip to content

Commit

Permalink
set default for port protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit Moussaud committed Jul 11, 2016
1 parent 6d1fb7a commit 28bfc5d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
6 changes: 1 addition & 5 deletions src/main/resources/docker/docker-create.sh.ftl
Expand Up @@ -26,11 +26,7 @@ echo "Running ${deployed_container.id}"
<#assign cmdLine = cmdLine + ["--entrypoint ${deployed_container.entryPoint}" ]/>
</#if>
<#list deployed_container.ports as port>
<#if (port.protocol??)>
<#assign cmdLine = cmdLine + ["--publish ${port.hostPort}:${port.containerPort}/${port.protocol}"]/>
<#else>
<#assign cmdLine = cmdLine + ["--publish ${port.hostPort}:${port.containerPort}"]/>
</#if>
<#assign cmdLine = cmdLine + ["--publish ${port.hostPort}:${port.containerPort}/${port.protocol}"]/>
</#list>
<#list deployed_container.links as link>
<#assign cmdLine = cmdLine + ["--link=${link.name}:${link.alias}"]/>
Expand Down
8 changes: 2 additions & 6 deletions src/main/resources/docker/docker-port.sh.ftl
Expand Up @@ -6,10 +6,6 @@
-->
<#include "/docker/setup-docker.ftl">
<#assign protocol = "tcp"/>
<#if (port.protocol??)>
<#assign protocol="${port.protocol}"/>
</#if>
echo "Test the port on ${name}"
echo "docker port ${name} ${port.containerPort}/${protocol}"
docker port ${name} ${port.containerPort}/${protocol}
echo "docker port ${name} ${port.containerPort}/${port.protocol}"
docker port ${name} ${port.containerPort}/${port.protocol}
2 changes: 1 addition & 1 deletion src/main/resources/synthetic.xml
Expand Up @@ -86,7 +86,7 @@
<generate-deployable type="docker.PortSpec" extends="udm.BaseEmbeddedDeployable"/>
<property name="hostPort" required="false" kind="integer"/>
<property name="containerPort" kind="integer"/>
<property name="protocol" required="false" description="e.g udp or tcp"/>
<property name="protocol" default="tcp" required="false" description="e.g udp or tcp"/>
<property name="testPort" kind="boolean" category="Advanced" default="false" required="false" description="Test if the port is open once the container has been started."/>
</type>

Expand Down

0 comments on commit 28bfc5d

Please sign in to comment.