Teatime 🇩🇰
11/20/2024, 9:32 AMpatches section also apply to migration jobs ?vroldanbet
11/20/2024, 10:47 AMTeatime 🇩🇰
11/20/2024, 10:49 AMvroldanbet
11/20/2024, 10:53 AMvroldanbet
11/20/2024, 10:54 AMecordell
11/20/2024, 3:11 PM- kind: Job
patch:
<thepatch>Teatime 🇩🇰
11/21/2024, 7:38 AMTeatime 🇩🇰
11/21/2024, 7:58 AM- kind: Job
patch:
op: add
path: /spec/template/spec/containers/0/env/-
value:
name: PGHOST
valueFrom:
configMapKeyRef:
name: database
key: db.hostTeatime 🇩🇰
11/22/2024, 8:04 AM- kind: Job
patch:
op: test
# Ensure that the index of the CONN_URI env var is correct
path: /spec/template/spec/containers/0/env/1/name
value: SPICEDB_DATASTORE_CONN_URI
- kind: Job
patch:
op: remove
# Delete the original CONN_URI env var, so we can re-add it, as the last one with varialble substitution
path: /spec/template/spec/containers/0/env/1
- kind: Job
patch:
op: add
path: /spec/template/spec/containers/0/env/-
value:
name: SPICEDB_DATASTORE_CONN_URI
value: "postgres://$(PGUSER):$(PGPASSWORD)@$(PGHOST):$(PGPORT)/$(PGDATABASE)?sslmode=require"ecordell
11/22/2024, 9:48 PMecordell
11/22/2024, 9:50 PMmerge patch, like:
- kind: Job
patch:
template:
spec:
containers:
- name: migrate
env:
- name: SPICEDB_DATASTORE_CONN_URI
value: "postgres://$(PGUSER):$(PGPASSWORD)@$(PGHOST):$(PGPORT)/$(PGDATABASE)?sslmode=require"
which should avoid the need for the test/remove operations you have (but warning: I didn't test this, I may have made some typos)