Skip to content

Commit c8a9efe

Browse files
authored
KubeArchive: quote password in the job directly (#7362)
Signed-off-by: Hector Martinez <[email protected]>
1 parent 0429452 commit c8a9efe

File tree

2 files changed

+19
-29
lines changed

2 files changed

+19
-29
lines changed

components/kubearchive/production/kflux-prd-rh03/database-secret.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

components/kubearchive/production/kflux-prd-rh03/kustomization.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
33
kind: Kustomization
44
resources:
55
- ../../base
6-
- database-secret.yaml
6+
- ../base
77
- https://github.com/kubearchive/kubearchive/releases/download/v1.2.0/kubearchive.yaml?timeout=90
88

99
namespace: product-kubearchive
@@ -19,6 +19,13 @@ patches:
1919
spec:
2020
containers:
2121
- name: migration
22+
args:
23+
- set -o errexit;
24+
git clone https://github.com/kubearchive/kubearchive --depth=1 --branch=${KUBEARCHIVE_VERSION} /tmp/kubearchive;
25+
cd /tmp/kubearchive;
26+
export QUOTED_PASSWORD=$(python3 -c "import urllib.parse; print(urllib.parse.quote('${DATABASE_PASSWORD}', ''))");
27+
curl --silent -L https://github.com/golang-migrate/migrate/releases/download/${MIGRATE_VERSION}/migrate.linux-amd64.tar.gz | tar xvz migrate;
28+
./migrate -verbose -path integrations/database/postgresql/migrations/ -database postgresql://${DATABASE_USER}:${QUOTED_PASSWORD}@${DATABASE_URL}:${DATABASE_PORT}/${DATABASE_DB} up
2229
env:
2330
- name: KUBEARCHIVE_VERSION
2431
value: v1.2.0
@@ -30,6 +37,17 @@ patches:
3037
metadata:
3138
name: kubearchive-database-credentials
3239
namespace: kubearchive
40+
- patch: |-
41+
apiVersion: external-secrets.io/v1beta1
42+
kind: ExternalSecret
43+
metadata:
44+
name: database-secret
45+
spec:
46+
secretStoreRef:
47+
name: appsre-stonesoup-vault
48+
dataFrom:
49+
- extract:
50+
key: production/platform/terraform/generated/kflux-prd-rh03/kubearchive-database
3351
# These patches add an annotation so an OpenShift service
3452
# creates the TLS secrets instead of Cert Manager
3553
- patch: |-

0 commit comments

Comments
 (0)