Skip to content

Commit 82c0207

Browse files
authored
Fixed hook execution order. (#257)
1 parent a282047 commit 82c0207

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

charts/eoapi/templates/pgstacbootstrap/configmap.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
name: pgstac-settings-config-{{ $.Release.Name }}
1010
annotations:
1111
helm.sh/hook: "post-install,post-upgrade"
12-
helm.sh/hook-weight: "-6"
12+
helm.sh/hook-weight: "-7"
1313
helm.sh/hook-delete-policy: "before-hook-creation,hook-succeeded"
1414
data:
1515
pgstac-settings.sql: |
@@ -22,7 +22,7 @@ metadata:
2222
name: initdb-sql-config-{{ $.Release.Name }}
2323
annotations:
2424
helm.sh/hook: "post-install,post-upgrade"
25-
helm.sh/hook-weight: "-6"
25+
helm.sh/hook-weight: "-7"
2626
helm.sh/hook-delete-policy: "before-hook-creation,hook-succeeded"
2727
data:
2828
initdb.sql: |
@@ -36,7 +36,7 @@ metadata:
3636
name: initdb-json-config-{{ $.Release.Name }}
3737
annotations:
3838
helm.sh/hook: "post-install,post-upgrade"
39-
helm.sh/hook-weight: "-6"
39+
helm.sh/hook-weight: "-7"
4040
helm.sh/hook-delete-policy: "before-hook-creation,hook-succeeded"
4141
data:
4242
{{- range $path, $bytes := $.Files.Glob "initdb-data/samples/*.json" -}}

charts/eoapi/templates/pgstacbootstrap/eoap-superuser-initdb.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ metadata:
1111
app: pgstac-eoapi-superuser-init-db
1212
annotations:
1313
helm.sh/hook: "post-install,post-upgrade"
14-
helm.sh/hook-weight: "-7"
14+
helm.sh/hook-weight: "-6"
1515
helm.sh/hook-delete-policy: "before-hook-creation"
1616
spec:
1717
template:
@@ -31,6 +31,10 @@ spec:
3131
# Exit immediately if a command exits with a non-zero status
3232
set -e
3333
34+
# Wait for the database to be ready
35+
echo "Waiting for database to be ready..."
36+
pypgstac pgready
37+
3438
# Run the initial setup with superuser
3539
PGUSER=postgres psql -f /opt/sql/initdb.sql
3640
@@ -77,5 +81,5 @@ spec:
7781
tolerations:
7882
{{- toYaml . | nindent 8 }}
7983
{{- end }}
80-
backoffLimit: 1
84+
backoffLimit: 5
8185
{{- end }}

0 commit comments

Comments
 (0)