Skip to content

Commit

Permalink
Refactor file into the right sample directory and fix checkstyle errors
Browse files Browse the repository at this point in the history
  • Loading branch information
milismsft committed Jun 20, 2017
1 parent 12b02da commit b32f63a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* license information.
*/

package com.microsoft.azure.management.containerregistry.samples;
package com.microsoft.azure.management.compute.samples;

import com.github.dockerjava.api.DockerClient;
import com.github.dockerjava.api.command.CreateContainerResponse;
Expand Down Expand Up @@ -412,12 +412,12 @@ public static boolean runSample(Azure azure, String clientId, String secret) {
// Wait until the external IP becomes available

int timeout = 30 * 60 * 1000; // 30 minutes
String IPV4_PATTERN = "^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}$";
String matchIPV4 = "^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}$";

while (timeout > 0) {
try {
List<LoadBalancerIngress> lbIngressList = kubernetesClient.services().inNamespace(acsNamespace).withName(acsLbIngressName).get().getStatus().getLoadBalancer().getIngress();
if (lbIngressList != null && !lbIngressList.isEmpty() && lbIngressList.get(0) != null && lbIngressList.get(0).getIp().matches(IPV4_PATTERN)) {
if (lbIngressList != null && !lbIngressList.isEmpty() && lbIngressList.get(0) != null && lbIngressList.get(0).getIp().matches(matchIPV4)) {
System.out.println("\tFound ingress IP: " + lbIngressList.get(0).getIp());
timeout = 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private SSHShell(String host, int port, String userName, byte[] sshPrivateKey)
}
}
JSch jsch = new JSch();
jsch.setKnownHosts(System.getProperty("user.home")+"/.ssh/known_hosts");
jsch.setKnownHosts(System.getProperty("user.home") + "/.ssh/known_hosts");
jsch.addIdentity(host, sshPrivateKey, (byte[]) null, (byte[]) null);
this.session = jsch.getSession(userName, host, port);
this.session.setConfig("StrictHostKeyChecking", "no");
Expand Down

0 comments on commit b32f63a

Please sign in to comment.