Merge pull request #72857 from ClickHouse/setup-minio-creds

setup_minio: Do not add aws credentials twice
This commit is contained in:
Nikita Fomichev 2024-12-09 14:33:23 +00:00 committed by GitHub
commit e83921d2cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -120,6 +120,12 @@ setup_aws_credentials() {
local minio_root_user=${MINIO_ROOT_USER:-clickhouse}
local minio_root_password=${MINIO_ROOT_PASSWORD:-clickhouse}
mkdir -p ~/.aws
if [[ -f ~/.aws/credentials ]]; then
if grep -q "^\[default\]" ~/.aws/credentials; then
echo "The credentials file contains a [default] section."
return
fi
fi
cat <<EOT >> ~/.aws/credentials
[default]
aws_access_key_id=${minio_root_user}