From 27dbe30ecb911cbc620ba440c72fbad7edde75d6 Mon Sep 17 00:00:00 2001 From: Dmitry Eliseev Date: Sun, 1 Aug 2021 07:44:51 +0300 Subject: [PATCH] Allow to specify secrets separately (#12813) --- dockerscripts/docker-entrypoint.sh | 36 +++++++++++++----------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/dockerscripts/docker-entrypoint.sh b/dockerscripts/docker-entrypoint.sh index a3f45fbeb..15317d366 100755 --- a/dockerscripts/docker-entrypoint.sh +++ b/dockerscripts/docker-entrypoint.sh @@ -35,15 +35,13 @@ docker_secrets_env_old() { SECRET_KEY_FILE="/run/secrets/$MINIO_SECRET_KEY_FILE" fi - if [ -f "$ACCESS_KEY_FILE" ] && [ -f "$SECRET_KEY_FILE" ]; then - if [ -f "$ACCESS_KEY_FILE" ]; then - MINIO_ACCESS_KEY="$(cat "$ACCESS_KEY_FILE")" - export MINIO_ACCESS_KEY - fi - if [ -f "$SECRET_KEY_FILE" ]; then - MINIO_SECRET_KEY="$(cat "$SECRET_KEY_FILE")" - export MINIO_SECRET_KEY - fi + if [ -f "$ACCESS_KEY_FILE" ]; then + MINIO_ACCESS_KEY="$(cat "$ACCESS_KEY_FILE")" + export MINIO_ACCESS_KEY + fi + if [ -f "$SECRET_KEY_FILE" ]; then + MINIO_SECRET_KEY="$(cat "$SECRET_KEY_FILE")" + export MINIO_SECRET_KEY fi } @@ -54,20 +52,18 @@ docker_secrets_env() { ROOT_USER_FILE="/run/secrets/$MINIO_ROOT_USER_FILE" fi if [ -f "$MINIO_ROOT_PASSWORD_FILE" ]; then - SECRET_KEY_FILE="$MINIO_ROOT_PASSWORD_FILE" + ROOT_PASSWORD_FILE="$MINIO_ROOT_PASSWORD_FILE" else - SECRET_KEY_FILE="/run/secrets/$MINIO_ROOT_PASSWORD_FILE" + ROOT_PASSWORD_FILE="/run/secrets/$MINIO_ROOT_PASSWORD_FILE" fi - if [ -f "$ROOT_USER_FILE" ] && [ -f "$SECRET_KEY_FILE" ]; then - if [ -f "$ROOT_USER_FILE" ]; then - MINIO_ROOT_USER="$(cat "$ROOT_USER_FILE")" - export MINIO_ROOT_USER - fi - if [ -f "$SECRET_KEY_FILE" ]; then - MINIO_ROOT_PASSWORD="$(cat "$SECRET_KEY_FILE")" - export MINIO_ROOT_PASSWORD - fi + if [ -f "$ROOT_USER_FILE" ]; then + MINIO_ROOT_USER="$(cat "$ROOT_USER_FILE")" + export MINIO_ROOT_USER + fi + if [ -f "$ROOT_PASSWORD_FILE" ]; then + MINIO_ROOT_PASSWORD="$(cat "$ROOT_PASSWORD_FILE")" + export MINIO_ROOT_PASSWORD fi }