Skip to content

Commit

Permalink
Reverted changes in SshBastionContainer (#13934)
Browse files Browse the repository at this point in the history
  • Loading branch information
suhomud committed Jun 20, 2022
1 parent c283d9d commit de05753
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ public JsonNode getTunnelConfig(final SshTunnel.TunnelMethod tunnelMethod, final

return Jsons.jsonNode(builderWithSchema
.put("tunnel_method", Jsons.jsonNode(ImmutableMap.builder()
.put("tunnel_host", bastion.getHost())
.put("tunnel_host",
Objects.requireNonNull(bastion.getContainerInfo().getNetworkSettings()
.getNetworks()
.get(((Network.NetworkImpl) network).getName())
.getIpAddress()))
.put("tunnel_method", tunnelMethod)
.put("tunnel_port", bastion.getFirstMappedPort())
.put("tunnel_port", bastion.getExposedPorts().get(0))
.put("tunnel_user", SSH_USER)
.put("tunnel_user_password", tunnelMethod.equals(SSH_PASSWORD_AUTH) ? SSH_PASSWORD : "")
.put("ssh_key", tunnelMethod.equals(SSH_KEY_AUTH) ? bastion.execInContainer("cat", "var/bastion/id_rsa").getStdout() : "")
Expand Down

0 comments on commit de05753

Please sign in to comment.