Skip to content

Commit afe0d41

Browse files
authored
KubeArchive: consolidate password encoding (#7364)
Signed-off-by: Hector Martinez <[email protected]>
1 parent 665a7e7 commit afe0d41

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

components/kubearchive/base/migration-job.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ spec:
2020
- set -o errexit;
2121
git clone https://github.com/kubearchive/kubearchive --depth=1 --branch=${KUBEARCHIVE_VERSION} /tmp/kubearchive;
2222
cd /tmp/kubearchive;
23+
export QUOTED_PASSWORD=$(python3 -c "import urllib.parse; print(urllib.parse.quote('${DATABASE_PASSWORD}', ''))");
2324
curl --silent -L https://github.com/golang-migrate/migrate/releases/download/${MIGRATE_VERSION}/migrate.linux-amd64.tar.gz | tar xvz migrate;
24-
./migrate -verbose -path integrations/database/postgresql/migrations/ -database postgresql://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_URL}:${DATABASE_PORT}/${DATABASE_DB} up
25+
./migrate -verbose -path integrations/database/postgresql/migrations/ -database postgresql://${DATABASE_USER}:${QUOTED_PASSWORD}@${DATABASE_URL}:${DATABASE_PORT}/${DATABASE_DB} up
2526
resources:
2627
limits:
2728
cpu: 10m

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@ 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
2922
env:
3023
- name: KUBEARCHIVE_VERSION
3124
value: v1.2.0

0 commit comments

Comments
 (0)