From e07962ca06586b7c1be99da9a5b9692af86ea8d3 Mon Sep 17 00:00:00 2001 From: pmossman Date: Tue, 29 Mar 2022 11:10:19 -0700 Subject: [PATCH] Revert "Revert "add /tmp emptyDir volume to connector pods (#10761)" (#11053)" This reverts commit eea515614cf84f35e8b085f37a0b7e740d0cc03e. --- .../airbyte/workers/process/KubePodProcess.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcess.java b/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcess.java index e296dc86a6371..159a6b1461f7e 100644 --- a/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcess.java +++ b/airbyte-workers/src/main/java/io/airbyte/workers/process/KubePodProcess.java @@ -114,6 +114,7 @@ public class KubePodProcess extends Process implements KubePod { private static final String STDOUT_PIPE_FILE = PIPES_DIR + "/stdout"; private static final String STDERR_PIPE_FILE = PIPES_DIR + "/stderr"; public static final String CONFIG_DIR = "/config"; + public static final String TMP_DIR = "/tmp"; private static final String TERMINATION_DIR = "/termination"; private static final String TERMINATION_FILE_MAIN = TERMINATION_DIR + "/main"; private static final String TERMINATION_FILE_CHECK = TERMINATION_DIR + "/check"; @@ -426,13 +427,24 @@ public KubePodProcess(final boolean isOrchestrator, .withMountPath(TERMINATION_DIR) .build(); + final Volume tmpVolume = new VolumeBuilder() + .withName("tmp") + .withNewEmptyDir() + .endEmptyDir() + .build(); + + final VolumeMount tmpVolumeMount = new VolumeMountBuilder() + .withName("tmp") + .withMountPath(TMP_DIR) + .build(); + final Container init = getInit(usesStdin, List.of(pipeVolumeMount, configVolumeMount), busyboxImage); final Container main = getMain( image, imagePullPolicy, usesStdin, entrypointOverride, - List.of(pipeVolumeMount, configVolumeMount, terminationVolumeMount), + List.of(pipeVolumeMount, configVolumeMount, terminationVolumeMount, tmpVolumeMount), resourceRequirements, internalToExternalPorts, envMap, @@ -500,7 +512,7 @@ public KubePodProcess(final boolean isOrchestrator, .withRestartPolicy("Never") .withInitContainers(init) .withContainers(containers) - .withVolumes(pipeVolume, configVolume, terminationVolume) + .withVolumes(pipeVolume, configVolume, terminationVolume, tmpVolume) .endSpec() .build();