Skip to content

Commit

Permalink
fix(setup_envdir): do not set AWS_ACCESS_KEY_ID if empty
Browse files Browse the repository at this point in the history
if these values are empty, then the user is using IAM credentials so we don't want these in the
environment
  • Loading branch information
Matthew Fisher committed Nov 18, 2016
1 parent 8448c7c commit d1744d5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rootfs/docker-entrypoint-initdb.d/001_setup_envdir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,12 @@ if [[ "$DATABASE_STORAGE" == "s3" || "$DATABASE_STORAGE" == "minio" ]]; then
echo "true" > S3_USE_SIGV4
fi
echo "s3://$BUCKET_NAME" > WALE_S3_PREFIX
echo $AWS_ACCESS_KEY_ID > AWS_ACCESS_KEY_ID
echo $AWS_SECRET_ACCESS_KEY > AWS_SECRET_ACCESS_KEY
# if these values are empty, then the user is using IAM credentials so we don't want these in the
# environment
if [[ "$AWS_ACCESS_KEY_ID" != "" && "AWS_SECRET_ACCESS_KEY" != "" ]]; then
echo $AWS_ACCESS_KEY_ID > AWS_ACCESS_KEY_ID
echo $AWS_SECRET_ACCESS_KEY > AWS_SECRET_ACCESS_KEY
fi
echo $AWS_REGION > AWS_REGION
echo $BUCKET_NAME > BUCKET_NAME
elif [ "$DATABASE_STORAGE" == "gcs" ]; then
Expand Down

0 comments on commit d1744d5

Please sign in to comment.