Skip to content

Commit c65300a

Browse files
authored
Allow the confoguration of the mongodb host, adds flexibility to the … (#113)
* Allow the confoguration of the mongodb host, adds flexibility to the chart * # This is a combination of 3 commits. # This is the 1st commit message: Update update-config-map.sh Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> # The commit message #2 will be skipped: # Fix wrong review # The commit message #3 will be skipped: # Fix if * Update update-config-map.sh
1 parent c7c28f8 commit c65300a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

deployment/templates/trs-filer-configmap-job.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ spec:
2828
value: {{ .Values.trs_filer.appName }}
2929
- name: HOST_NAME
3030
value: {{ .Values.host_name }}
31+
- name: MONGO_HOST
32+
value: mongodb-{{ .Values.trs_filer.appName }}
3133
restartPolicy: Never
3234
serviceAccountName: {{ .Values.trs_filer.appName }}-configurer
3335
status: {}

update-config-map.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@ then
1010
env
1111
exit 1
1212
fi
13+
14+
if [ -z "$MONGO_HOST" ];
15+
then
16+
MONGO_HOST='mongodb'
17+
fi
18+
1319
echo "Inputs:"
1420
echo " CONFIG MAP NAME: $CONFIG_MAP_NAME"
1521
echo " API SERVER: $APISERVER"
1622
echo " APP CONFIG PATH: $APP_CONFIG_PATH"
1723
echo " WES APP NAME: $APP_NAME"
1824
echo " HOST NAME: $HOST_NAME"
25+
echo " MONGO_HOST: $MONGO_HOST"
1926

2027
NAMESPACE=$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)
2128

@@ -31,9 +38,11 @@ echo "Current Kubernetes namespace: $NAMESPACE"; echo
3138
echo " * Getting current default configuration"
3239

3340
APP_CONFIG=$(yq --arg HOST_NAME "$HOST_NAME" \
41+
--arg MONGO_HOST "$MONGO_HOST" \
3442
'.endpoints.service.url_prefix = "https" |
3543
.endpoints.service.external_host = $HOST_NAME |
36-
.endpoints.service.external_port = 443' \
44+
.endpoints.service.external_port = 443 |
45+
.db.host = $MONGO_HOST' \
3746
"$APP_CONFIG_PATH") || exit 4
3847

3948
echo " * Getting current configMap"

0 commit comments

Comments
 (0)