From 276f89ac1c0356eca9b6692f970083583a57dfe5 Mon Sep 17 00:00:00 2001 From: Neel Dalsania <92356010+neel-astro@users.noreply.github.com> Date: Thu, 20 Jan 2022 22:25:38 +0530 Subject: [PATCH] fixed volume and postgres container naming convention in docker compose (#482) --- airflow/container.go | 2 +- airflow/docker_test.go | 3 +++ airflow/include/composeyml.go | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/airflow/container.go b/airflow/container.go index 33768b9b4..08f7dfd80 100644 --- a/airflow/container.go +++ b/airflow/container.go @@ -140,7 +140,7 @@ func generateConfig(projectName, airflowHome, envFile string, imageLabels map[st AirflowWebserverPort: config.CFG.WebserverPort.GetString(), AirflowEnvFile: envFile, MountLabel: "z", - ProjectName: projectName, + ProjectName: sanitizeRepoName(projectName), TriggererEnabled: triggererEnabled, SchedulerContainerName: config.CFG.SchedulerContainerName.GetString(), WebserverContainerName: config.CFG.WebserverContainerName.GetString(), diff --git a/airflow/docker_test.go b/airflow/docker_test.go index 07fa43de7..b07fbfc31 100644 --- a/airflow/docker_test.go +++ b/airflow/docker_test.go @@ -55,12 +55,15 @@ networks: volumes: postgres_data: driver: local + name: test-project-name_postgres_data airflow_logs: driver: local + name: test-project-name_airflow_logs services: postgres: image: postgres:12.2 + container_name: test-project-name-postgres restart: unless-stopped networks: - airflow diff --git a/airflow/include/composeyml.go b/airflow/include/composeyml.go index 4fc1220e5..ea4d38ddc 100644 --- a/airflow/include/composeyml.go +++ b/airflow/include/composeyml.go @@ -13,12 +13,15 @@ networks: volumes: postgres_data: driver: local + name: {{ .ProjectName }}_postgres_data airflow_logs: driver: local + name: {{ .ProjectName }}_airflow_logs services: postgres: image: postgres:12.2 + container_name: {{ .ProjectName }}-postgres restart: unless-stopped networks: - airflow