Skip to content

Commit

Permalink
Adding optional config parameter 'sshHost' differentiating between ht…
Browse files Browse the repository at this point in the history
…tp api host and host running containers
  • Loading branch information
mmcgarr committed Apr 29, 2015
1 parent 20db4ba commit 0e7dcbe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public class DockerCloud extends Cloud {

public final List<DockerTemplate> templates;
public final String serverUrl;
public final String sshHost;
public final int containerCap;

public final int connectTimeout;
Expand All @@ -100,6 +101,7 @@ public class DockerCloud extends Cloud {
public DockerCloud(String name,
List<? extends DockerTemplate> templates,
String serverUrl,
String sshHost,
String containerCapStr,
int connectTimeout,
int readTimeout,
Expand All @@ -111,6 +113,7 @@ public DockerCloud(String name,
this.version = version;
this.credentialsId = credentialsId;
this.serverUrl = serverUrl;
this.sshHost = "".equals(sshHost) ? serverUrl : sshHost;
this.connectTimeout = connectTimeout;
this.readTimeout = readTimeout;
if (templates != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private static SSHLauncher getSSHLauncher(InspectContainerResponse detail, Docke
}

if (host == null || host.equals("0.0.0.0")) {
URL hostUrl = new URL(template.getParent().serverUrl);
URL hostUrl = new URL(template.getParent().sshHost);
host = hostUrl.getHost();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<f:textbox />
</f:entry>

<f:entry title="${%Docker SSH host}" field="sshHost">
<f:textbox />
</f:entry>

<f:entry title="${%Docker Version}" field="version">
<f:textbox />
</f:entry>
Expand Down

0 comments on commit 0e7dcbe

Please sign in to comment.