Skip to content

Commit

Permalink
Solve the problrem by removing use of the redundant docdb_host/docdb_…
Browse files Browse the repository at this point in the history
…port values

MASCORE-2563
  • Loading branch information
tomklapiscak committed Apr 30, 2024
1 parent bd02c3e commit bd72205
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,5 @@ data:
docdb_master_password: {{ .Values.docdb.master_password }}
docdb_master_info: {{ .Values.docdb.master_info }}
docdb_instance_password: {{ .Values.docdb.instance_password }}
docdb_host: {{ .Values.docdb.host }}
docdb_port: {{ .Values.docdb.port }}
type: Opaque
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,6 @@ spec:
- name: MAS_INSTANCE_ID
value: "{{ .Values.instance.id }}"

- name: DOCDB_HOST
valueFrom:
secretKeyRef:
name: aws-docdb
key: docdb_host
- name: DOCDB_PORT
valueFrom:
secretKeyRef:
name: aws-docdb
key: docdb_port
- name: DOCDB_MASTER_USERNAME
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -97,6 +87,10 @@ spec:
OUTPUT_FILE=${MAS_CONFIG_DIR}/docdb-${MAS_INSTANCE_ID}-instance-credentials.yml
export USER_ACTION="add"
# Grab one of the hosts/ports out of docdb master info
export DOCDB_HOST=$(echo "${DOCDB_MASTER_INFO}" | sed 's/\\n/\n/g' | /usr/bin/yq '.config.hosts[0].host')
export DOCDB_PORT=$(echo "${DOCDB_MASTER_INFO}" | sed 's/\\n/\n/g' | /usr/bin/yq '.config.hosts[0].port')
echo "Params:"
echo " - MAS_INSTANCE_ID ................... ${MAS_INSTANCE_ID}"
echo " - MAS_CONFIG_DIR ................... ${MAS_CONFIG_DIR}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@ spec:
- name: MAS_INSTANCE_ID
value: "{{ .Values.instance.id }}"

- name: DOCDB_HOST
valueFrom:
secretKeyRef:
name: aws-docdb
key: docdb_host
- name: DOCDB_PORT
valueFrom:
secretKeyRef:
name: aws-docdb
key: docdb_port
- name: DOCDB_MASTER_USERNAME
valueFrom:
secretKeyRef:
Expand Down Expand Up @@ -79,6 +69,10 @@ spec:
export MAS_CONFIG_DIR="/tmp/${MAS_INSTANCE_ID}/aws_documentdb_user"
export USER_ACTION="remove"
# Grab one of the hosts/ports out of docdb master info
export DOCDB_HOST=$(echo "${DOCDB_MASTER_INFO}" | sed 's/\\n/\n/g' | /usr/bin/yq '.config.hosts[0].host')
export DOCDB_PORT=$(echo "${DOCDB_MASTER_INFO}" | sed 's/\\n/\n/g' | /usr/bin/yq '.config.hosts[0].port')
echo "Params:"
echo " - MAS_INSTANCE_ID ................... ${MAS_INSTANCE_ID}"
echo " - MAS_CONFIG_DIR ................... ${MAS_CONFIG_DIR}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ spec:
master_password: {{ .Values.ibm_sls.docdb_master_password }}
instance_password: {{ .Values.ibm_sls.sls_mongo_password }}
master_info: {{ .Values.ibm_sls.docdb_master_info }}
host: {{ .Values.ibm_sls.docdb_host }}
port: {{ .Values.ibm_sls.docdb_port }}
{{- end }}
{{- end }}
- name: ARGOCD_APP_NAME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ spec:
docdb:
master_username: {{ .Values.ibm_sls.docdb_master_username }}
master_password: {{ .Values.ibm_sls.docdb_master_password }}
master_info: {{ .Values.ibm_sls.docdb_master_info }}
instance_password: {{ .Values.ibm_sls.sls_mongo_password }}
host: {{ .Values.ibm_sls.docdb_host }}
port: {{ .Values.ibm_sls.docdb_port }}
master_info: {{ .Values.ibm_sls.docdb_master_info }}
{{- end }}
{{- end }}
- name: ARGOCD_APP_NAME
Expand Down

0 comments on commit bd72205

Please sign in to comment.