From 7d318754177c95161a50b7b2a8d4d47af5dd4b41 Mon Sep 17 00:00:00 2001 From: Ryan Lewon Date: Tue, 19 Mar 2024 16:07:57 -0700 Subject: [PATCH] Needed for temporal and workers to connect to each other via IPv6. --- .../java/io/airbyte/workers/process/KubeProcessFactory.java | 2 +- .../config/ContainerOrchestratorFactory.java | 2 +- .../io/airbyte/workers/config/ProcessFactoryBeanFactory.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/airbyte-commons-worker/src/main/java/io/airbyte/workers/process/KubeProcessFactory.java b/airbyte-commons-worker/src/main/java/io/airbyte/workers/process/KubeProcessFactory.java index 1cbe6d1ebb6..df6a46d9f06 100644 --- a/airbyte-commons-worker/src/main/java/io/airbyte/workers/process/KubeProcessFactory.java +++ b/airbyte-commons-worker/src/main/java/io/airbyte/workers/process/KubeProcessFactory.java @@ -105,7 +105,7 @@ public KubeProcessFactory(final WorkerConfigsProvider workerConfigsProvider, this.serviceAccount = serviceAccount; this.fabricClient = fabricClient; this.kubeHeartbeatUrl = kubeHeartbeatUrl; - this.processRunnerHost = processRunnerHost; + this.processRunnerHost = processRunnerHost.contains(":") ? "[" + processRunnerHost + "]" : processRunnerHost;; } @Override diff --git a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/config/ContainerOrchestratorFactory.java b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/config/ContainerOrchestratorFactory.java index 6130ed8a2ab..639d43ed753 100644 --- a/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/config/ContainerOrchestratorFactory.java +++ b/airbyte-container-orchestrator/src/main/java/io/airbyte/container_orchestrator/config/ContainerOrchestratorFactory.java @@ -95,7 +95,7 @@ ProcessFactory kubeProcessFactory( @Value("${airbyte.worker.job.kube.serviceAccount}") final String serviceAccount) throws UnknownHostException { final var localIp = InetAddress.getLocalHost().getHostAddress(); - final var kubeHeartbeatUrl = localIp + ":" + serverPort; + final String kubeHeartbeatUrl = localIp.contains(":") ? "[" + localIp + "]:" + serverPort : localIp + ":" + serverPort; // this needs to have two ports for the source and two ports for the destination (all four must be // exposed) diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/config/ProcessFactoryBeanFactory.java b/airbyte-workers/src/main/java/io/airbyte/workers/config/ProcessFactoryBeanFactory.java index 8818a3c5b6f..6e1e74e1bc9 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/config/ProcessFactoryBeanFactory.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/config/ProcessFactoryBeanFactory.java @@ -54,7 +54,7 @@ public ProcessFactory createKubernetesProcessFactory(final WorkerConfigsProvider throws UnknownHostException { final KubernetesClient fabricClient = new DefaultKubernetesClient(); final String localIp = InetAddress.getLocalHost().getHostAddress(); - final String kubeHeartbeatUrl = localIp + ":" + serverPort; + final String kubeHeartbeatUrl = localIp.contains(":") ? "[" + localIp + "]:" + serverPort : localIp + ":" + serverPort; return new KubeProcessFactory(workerConfigsProvider, featureFlagClient, kubernetesNamespace,