Skip to content
Snippets Groups Projects
Verified Commit c83de8fc authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

Install new dsn configuration pattern for listers

Refs. swh/meta#4949
parent 589fad02
No related branches found
No related tags found
No related merge requests found
...@@ -57,22 +57,38 @@ data: ...@@ -57,22 +57,38 @@ data:
task_queues: task_queues:
{{- range $queue := get $deployment_config "queues" }} {{- range $queue := get $deployment_config "queues" }}
- {{ $queue }} - {{ $queue }}
sentry_settings_for_celery_tasks:
__sentry-settings-for-celery-tasks__
{{- end }} {{- end }}
credentials: credentials:
__lister-credentials__
init-container-entrypoint.sh: | init-container-entrypoint.sh: |
#!/bin/bash #!/bin/bash
set -e set -e
CONFIG_FILE=/etc/swh/config.yml CONFIG_FILE=/etc/swh/config.yml
CONFIG_FILE_WIP=/tmp/wip-config.yml
# substitute environment variables when creating the default config.yml # substitute environment variables when creating the default config.yml
eval echo \""$(</etc/swh/configuration-template/config.yml.template)"\" \ eval echo \""$(</etc/swh/configuration-template/config.yml.template)"\" \
> $CONFIG_FILE > $CONFIG_FILE
CREDS_LISTER_PATH=/etc/credentials/listers/credentials SENTRY_SETTINGS_PATH=/etc/credentials/sentry-settings/sentry_settings_for_celery_tasks
[ -f $CREDS_LISTER_PATH ] && \ if [ -f $SENTRY_SETTINGS_PATH ]; then
sed 's/^/ /g' $CREDS_LISTER_PATH >> $CONFIG_FILE awk "/__sentry-settings-for-celery-tasks__/{system(\"sed 's/^/ /g' $SENTRY_SETTINGS_PATH\");next}1" $CONFIG_FILE > $CONFIG_FILE_WIP
mv $CONFIG_FILE_WIP $CONFIG_FILE
else
sed -i '/__sentry-settings-for-celery-tasks__//g' $CONFIG_FILE
fi
if [ -f $CREDS_LISTER_PATH ]; then
awk "/__lister-credentials__/{system(\"sed 's/^/ /g' $CREDS_LISTER_PATH\");next}1" $CONFIG_FILE > $CONFIG_FILE_WIP
mv $CONFIG_FILE_WIP $CONFIG_FILE
else
sed -i '/__lister-credentials__//g' $CONFIG_FILE
fi
exit 0 exit 0
{{ end }} {{ end }}
......
...@@ -64,6 +64,9 @@ spec: ...@@ -64,6 +64,9 @@ spec:
- name: lister-credentials-secrets - name: lister-credentials-secrets
mountPath: /etc/credentials/listers mountPath: /etc/credentials/listers
readOnly: true readOnly: true
- name: sentry-settings-for-celery-tasks
mountPath: /etc/credentials/sentry-settings
readOnly: true
containers: containers:
- name: listers - name: listers
resources: resources:
...@@ -94,15 +97,6 @@ spec: ...@@ -94,15 +97,6 @@ spec:
value: /etc/swh/config.yml value: /etc/swh/config.yml
- name: SWH_SENTRY_ENVIRONMENT - name: SWH_SENTRY_ENVIRONMENT
value: {{ $.Values.sentry.environment }} value: {{ $.Values.sentry.environment }}
- name: SWH_MAIN_PACKAGE
value: {{ $.Values.listers.sentrySwhPackage }}
- name: SWH_SENTRY_DSN
valueFrom:
secretKeyRef:
name: common-secrets
key: lister-sentry-dsn
# 'name' secret must exist & include key "host"
optional: false
volumeMounts: volumeMounts:
- name: lister-utils - name: lister-utils
mountPath: /pre-stop.sh mountPath: /pre-stop.sh
...@@ -132,5 +126,9 @@ spec: ...@@ -132,5 +126,9 @@ spec:
secret: secret:
secretName: lister-credentials-secrets secretName: lister-credentials-secrets
optional: true optional: true
- name: sentry-settings-for-celery-tasks
secret:
secretName: sentry-settings-for-celery-tasks
optional: true
{{ end }} {{ end }}
{{- end -}} {{- end -}}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment