Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add possibiity to change the mongodb host #51

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions deployment/templates/cloud-registry-configmap-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ spec:
value: {{ .Values.cloud_registry.appName }}
- name: HOST_NAME
value: {{ .Values.host_name }}
- name: MONGO_HOST
jemaltahir marked this conversation as resolved.
Show resolved Hide resolved
value: mongodb-{{ .Values.cloud-registry.appName }}
restartPolicy: Never
serviceAccountName: {{ .Values.cloud_registry.appName }}-configurer
status: {}
Expand Down
10 changes: 9 additions & 1 deletion update-config-map.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ then
env
exit 1
fi

if [ -z "$MONGO_HOST" ];
then
MONGO_HOST='mongodb'
jemaltahir marked this conversation as resolved.
Show resolved Hide resolved
fi

echo "Inputs:"
echo " CONFIG MAP NAME: $CONFIG_MAP_NAME"
echo " API SERVER: $APISERVER"
echo " APP CONFIG PATH: $APP_CONFIG_PATH"
echo " WES APP NAME: $APP_NAME"
echo " HOST NAME: $HOST_NAME"
echo " MONGO_HOST: $MONGO_HOST"

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

Expand All @@ -33,7 +40,8 @@ echo " * Getting current default configuration"
APP_CONFIG=$(yq --arg HOST_NAME "$HOST_NAME" \
'.endpoints.service.url_prefix = "https" |
.endpoints.service.external_host = $HOST_NAME |
.endpoints.service.external_port = 443' \
.endpoints.service.external_port = 443 |
.db.host = $MONGO_HOST' \
jemaltahir marked this conversation as resolved.
Show resolved Hide resolved
"$APP_CONFIG_PATH") || exit 4

echo " * Getting current configMap"
Expand Down
Loading