From 4169dcb31098e201f30bdc7e165f59209459abb9 Mon Sep 17 00:00:00 2001 From: dandds Date: Thu, 17 Oct 2019 14:32:27 -0400 Subject: [PATCH] Fix CI/CD bug with PGSSLROOTCERT. Because I pushed the environment variable changes to the cluster already, psycopg2 was automatically trying to connect to the database using the file specified in PGSSLROOTCERT. That ConfigMap was not mounted into the migrations container, so I'm doing that here. --- deploy/shared/migration.yaml | 10 ++++++++++ script/cluster_migration | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/deploy/shared/migration.yaml b/deploy/shared/migration.yaml index cbf7da6b..c26ca543 100644 --- a/deploy/shared/migration.yaml +++ b/deploy/shared/migration.yaml @@ -31,6 +31,9 @@ spec: - name: atst-config mountPath: "/opt/atat/atst/atst-overrides.ini" subPath: atst-overrides.ini + - name: pgsslrootcert + mountPath: "/opt/atat/atst/ssl/pgsslrootcert.crt" + subPath: pgsslrootcert.crt volumes: - name: atst-config secret: @@ -39,4 +42,11 @@ spec: - key: override.ini path: atst-overrides.ini mode: 0644 + - name: pgsslrootcert + configMap: + name: pgsslrootcert + items: + - key: cert + path: pgsslrootcert.crt + mode: 0666 restartPolicy: Never diff --git a/script/cluster_migration b/script/cluster_migration index 0c57c9d8..03a85a29 100755 --- a/script/cluster_migration +++ b/script/cluster_migration @@ -28,7 +28,7 @@ if echo "$JOB_SUCCESS" | grep -q "condition met"; then else POD_NAME=$(${K8S_CMD} -n atat get pods -l job-name=migration -o=jsonpath='{.items[0].metadata.name}') echo "Job failed:" - $K8S_CMD -n atat log $POD_NAME + $K8S_CMD -n atat logs $POD_NAME delete_job exit 1 fi