Skip to content

Commit 86157c6

Browse files
authored
Add possibiity to change the mongodb host (#51)
1 parent 637f081 commit 86157c6

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

deployment/templates/cloud-registry-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.cloud_registry.appName }}
2929
- name: HOST_NAME
3030
value: {{ .Values.host_name }}
31+
- name: MONGO_HOST
32+
value: mongodb-{{ .Values.cloud-registry.appName }}
3133
restartPolicy: Never
3234
serviceAccountName: {{ .Values.cloud_registry.appName }}-configurer
3335
status: {}

update-config-map.sh

Lines changed: 9 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

@@ -33,7 +40,8 @@ echo " * Getting current default configuration"
3340
APP_CONFIG=$(yq --arg HOST_NAME "$HOST_NAME" \
3441
'.endpoints.service.url_prefix = "https" |
3542
.endpoints.service.external_host = $HOST_NAME |
36-
.endpoints.service.external_port = 443' \
43+
.endpoints.service.external_port = 443 |
44+
.db.host = $MONGO_HOST' \
3745
"$APP_CONFIG_PATH") || exit 4
3846

3947
echo " * Getting current configMap"

0 commit comments

Comments
 (0)