From a17db3a262b291961483c95662fe9d0d42a942b9 Mon Sep 17 00:00:00 2001 From: Philippe Caseiro Date: Thu, 26 Sep 2024 10:31:29 +0200 Subject: [PATCH] TRY 0004 --- .../hydra-cnpg-database/kustomization.yaml | 16 ++++++++-------- .../patches/hydra-migrate-job.yaml | 14 +++++++++++--- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/components/hydra-cnpg-database/kustomization.yaml b/components/hydra-cnpg-database/kustomization.yaml index 3a6746b..b9de1f6 100644 --- a/components/hydra-cnpg-database/kustomization.yaml +++ b/components/hydra-cnpg-database/kustomization.yaml @@ -20,14 +20,14 @@ resources: # - username=hydra # - password=NotSoSecret -vars: -- name: HYDRA_DATABASE_SERVICE_NAME - objref: - name: hydra-postgres - kind: Cluster - apiVersion: postgresql.cnpg.io/v1 - fieldref: - fieldpath: metadata.name +#vars: +#- name: HYDRA_DATABASE_SERVICE_NAME +# objref: +# name: hydra-postgres +# kind: Cluster +# apiVersion: postgresql.cnpg.io/v1 +# fieldref: +# fieldpath: metadata.name patches: - target: diff --git a/components/hydra-cnpg-database/patches/hydra-migrate-job.yaml b/components/hydra-cnpg-database/patches/hydra-migrate-job.yaml index 6185612..c7d5def 100644 --- a/components/hydra-cnpg-database/patches/hydra-migrate-job.yaml +++ b/components/hydra-cnpg-database/patches/hydra-migrate-job.yaml @@ -4,7 +4,7 @@ name: HYDRA_DATABASE_USER valueFrom: secretKeyRef: - name: hydra-postgres-user + name: hydra-postgres-app key: username - op: add path: "/spec/template/spec/containers/0/env/-" @@ -12,10 +12,18 @@ name: HYDRA_DATABASE_PASSWORD valueFrom: secretKeyRef: - name: hydra-postgres-user + name: hydra-postgres-app key: password +- op: add + path: "/spec/template/spec/containers/0/env/-" + value: + name: HYDRA_DATABASE_SERVICE_NAME + valueFrom: + secretKeyRef: + name: hydra-postgres-app + key: host - op: add path: "/spec/template/spec/containers/0/env/-" value: name: DSN - value: "postgres://$(HYDRA_DATABASE_USER):$(HYDRA_DATABASE_PASSWORD)@$(HYDRA_DATABASE_SERVICE_NAME)-rw:5432/hydra?sslmode=disable" \ No newline at end of file + value: "postgres://$(HYDRA_DATABASE_USER):$(HYDRA_DATABASE_PASSWORD)@$(HYDRA_DATABASE_SERVICE_NAME)-rw:5432/hydra?sslmode=disable"