Skip to content

Commit

Permalink
[PLAT-12946] Overwrite sshPort in case it is not NULL
Browse files Browse the repository at this point in the history
Summary:
We were falling back to context.sshPort even in case it was null, which overwrites the
sshPort to null.
This diff fixes the same.

Test Plan: Manual Testing

Reviewers: vbansal

Reviewed By: vbansal

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D32811
  • Loading branch information
Vars-07 committed Mar 4, 2024
1 parent d38cbeb commit 728802b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -471,10 +471,10 @@ private void addConnectionParams(
String sshPort = provider.getDetails().sshPort.toString();
commandArgs.add("ssh");
// Default SSH port can be the custom port for custom images.
if (context.getSshPort() == null
if (StringUtils.isBlank(context.getSshPort())
&& Util.isAddressReachable(node.cloudInfo.private_ip, 22)) {
sshPort = "22";
} else {
} else if (!StringUtils.isNotBlank(context.getSshPort())) {
sshPort = context.getSshPort();
}
commandArgs.add("--port");
Expand Down

0 comments on commit 728802b

Please sign in to comment.