Skip to content

Commit

Permalink
[bitnami/mongodb] Fixed awk script to extract in order to be more str…
Browse files Browse the repository at this point in the history
…ict on primary property retrieve by `db.runCommand("ismaster")` command in setup.sh.

Signed-off-by: b4nks <b4nks@protonmail.com>
Signed-off-by: Nicolas Bernard <n.bernard@ateme.com>
  • Loading branch information
Nicolas Bernard committed Oct 9, 2024
1 parent 0d2b826 commit adbc444
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bitnami/mongodb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ maintainers:
name: mongodb
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/mongodb
version: 16.0.1
version: 16.0.2
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ data:
{{- if .Values.externalAccess.externalMaster.enabled }}
current_primary={{ printf "%s:%d" (.Values.externalAccess.externalMaster.host) ( int .Values.externalAccess.externalMaster.port) }}
{{- else }}
current_primary=$(mongosh admin --host "{{ join "," $mongoList }}" {{- if .Values.auth.enabled }} --authenticationDatabase admin -u $MONGODB_ROOT_USER -p $MONGODB_ROOT_PASSWORD{{- end }}{{- if .Values.tls.enabled}} --tls {{ if .Values.tls.mTLS.enabled }}--tlsCertificateKeyFile=/certs/mongodb.pem {{ end }}--tlsCAFile=/certs/mongodb-ca-cert{{- end }} --eval 'db.runCommand("ismaster")' | awk -F\' '/primary/ {print $2}')
current_primary=$(mongosh admin --host "{{ join "," $mongoList }}" {{- if .Values.auth.enabled }} --authenticationDatabase admin -u $MONGODB_ROOT_USER -p $MONGODB_ROOT_PASSWORD{{- end }}{{- if .Values.tls.enabled}} --tls {{ if .Values.tls.mTLS.enabled }}--tlsCertificateKeyFile=/certs/mongodb.pem {{ end }}--tlsCAFile=/certs/mongodb-ca-cert{{- end }} --eval 'db.runCommand("ismaster")' | awk -F\' '/primary:/ {print $2}')
{{- end }}
if ! is_empty_value "$current_primary"; then
info "Detected existing primary: ${current_primary}"
Expand Down

0 comments on commit adbc444

Please sign in to comment.