@Test public void getCurrentHostname_k8s() throws Exception { assertThat(K8S_INSTANCE.getCurrentHostname()).isEqualTo("svc-47775-2.svc-47775.namespace"); }
public String getCurrentHostname() { Matcher matcher = getHostnameComponents(); return String.format( POD_HOSTNAME_TEMPLATE, matcher.group("service"), Integer.valueOf(matcher.group("podId")), matcher.group("service"), matcher.group("namespace")); }
KubernetesHostnames { public String getCurrentHostname() { Matcher matcher = getHostnameComponents(); return String.format( POD_HOSTNAME_TEMPLATE, matcher.group("service"), Integer.valueOf(matcher.group("podId")), matcher.group("service"), matcher.group("namespace")); } }
KubernetesHostnames { public String getCurrentHostname() { Matcher matcher = getHostnameComponents(); return String.format( POD_HOSTNAME_TEMPLATE, matcher.group("service"), Integer.valueOf(matcher.group("podId")), matcher.group("service"), matcher.group("namespace")); } @VisibleForTesting  KubernetesHostnames(Supplier<String> currentHostnameSupplier); }
KubernetesHostnames { public String getCurrentHostname() { Matcher matcher = getHostnameComponents(); return String.format( POD_HOSTNAME_TEMPLATE, matcher.group("service"), Integer.valueOf(matcher.group("podId")), matcher.group("service"), matcher.group("namespace")); } @VisibleForTesting  KubernetesHostnames(Supplier<String> currentHostnameSupplier); String getCurrentHostname(); List<String> getClusterMembers(int expectedClusterSize); }
KubernetesHostnames { public String getCurrentHostname() { Matcher matcher = getHostnameComponents(); return String.format( POD_HOSTNAME_TEMPLATE, matcher.group("service"), Integer.valueOf(matcher.group("podId")), matcher.group("service"), matcher.group("namespace")); } @VisibleForTesting  KubernetesHostnames(Supplier<String> currentHostnameSupplier); String getCurrentHostname(); List<String> getClusterMembers(int expectedClusterSize); static final KubernetesHostnames INSTANCE; }