Allow to specify secrets separately (#12813)

This commit is contained in:
Dmitry Eliseev 2021-08-01 07:44:51 +03:00 committed by GitHub
parent 0a62ae4e61
commit 27dbe30ecb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 20 deletions

View File

@ -35,7 +35,6 @@ 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
@ -44,7 +43,6 @@ docker_secrets_env_old() {
MINIO_SECRET_KEY="$(cat "$SECRET_KEY_FILE")"
export MINIO_SECRET_KEY
fi
fi
}
docker_secrets_env() {
@ -54,21 +52,19 @@ 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")"
if [ -f "$ROOT_PASSWORD_FILE" ]; then
MINIO_ROOT_PASSWORD="$(cat "$ROOT_PASSWORD_FILE")"
export MINIO_ROOT_PASSWORD
fi
fi
}
## Set KMS_SECRET_KEY from docker secrets if provided