[bitnami/mongodb] Check for MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD when setting auth config (#52272)

Check for MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD when setting auth config

Signed-off-by: Douglas Thomson <djt210@gmail.com>
This commit is contained in:
Douglas Thomson
2023-11-14 10:47:52 +01:00
committed by GitHub
parent 28f9b6b222
commit 64bfec4c41
3 changed files with 3 additions and 3 deletions
@@ -606,7 +606,7 @@ mongodb_set_auth_conf() {
local authorization
if ! mongodb_is_file_external "$conf_file_name"; then
if [[ -n "$MONGODB_ROOT_PASSWORD" ]] || [[ -n "$MONGODB_PASSWORD" ]]; then
if [[ -n "$MONGODB_ROOT_PASSWORD" ]] || [[ -n "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" ]] || [[ -n "$MONGODB_PASSWORD" ]]; then
authorization="$(yq eval .security.authorization "$MONGODB_CONF_FILE")"
if [[ "$authorization" = "disabled" ]]; then
@@ -606,7 +606,7 @@ mongodb_set_auth_conf() {
local authorization
if ! mongodb_is_file_external "$conf_file_name"; then
if [[ -n "$MONGODB_ROOT_PASSWORD" ]] || [[ -n "$MONGODB_PASSWORD" ]]; then
if [[ -n "$MONGODB_ROOT_PASSWORD" ]] || [[ -n "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" ]] || [[ -n "$MONGODB_PASSWORD" ]]; then
authorization="$(yq eval .security.authorization "$MONGODB_CONF_FILE")"
if [[ "$authorization" = "disabled" ]]; then
@@ -606,7 +606,7 @@ mongodb_set_auth_conf() {
local authorization
if ! mongodb_is_file_external "$conf_file_name"; then
if [[ -n "$MONGODB_ROOT_PASSWORD" ]] || [[ -n "$MONGODB_PASSWORD" ]]; then
if [[ -n "$MONGODB_ROOT_PASSWORD" ]] || [[ -n "$MONGODB_INITIAL_PRIMARY_ROOT_PASSWORD" ]] || [[ -n "$MONGODB_PASSWORD" ]]; then
authorization="$(yq eval .security.authorization "$MONGODB_CONF_FILE")"
if [[ "$authorization" = "disabled" ]]; then