Skip to content

Commit

Permalink
fix(gcs): Use correct env variable for the gcs service account file path
Browse files Browse the repository at this point in the history
  • Loading branch information
kmala committed Nov 22, 2016
1 parent 8d34bc9 commit 3984d62
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rootfs/bin/create_bucket
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ if os.getenv('DATABASE_STORAGE') == "s3":

elif os.getenv('DATABASE_STORAGE') == "gcs":
scopes = ['https://www.googleapis.com/auth/devstorage.full_control']
credentials = ServiceAccountCredentials.from_json_keyfile_name(os.getenv('GS_APPLICATION_CREDS'), scopes=scopes)
with open(os.getenv('GS_APPLICATION_CREDS')) as data_file:
credentials = ServiceAccountCredentials.from_json_keyfile_name(os.getenv('GOOGLE_APPLICATION_CREDENTIALS'), scopes=scopes)
with open(os.getenv('GOOGLE_APPLICATION_CREDENTIALS')) as data_file:
data = json.load(data_file)
conn = Client(credentials=credentials, project=data['project_id'])
exists = True
Expand Down
4 changes: 2 additions & 2 deletions rootfs/docker-entrypoint-initdb.d/001_setup_envdir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ if [[ "$DATABASE_STORAGE" == "s3" || "$DATABASE_STORAGE" == "minio" ]]; then
echo $AWS_REGION > AWS_REGION
echo $BUCKET_NAME > BUCKET_NAME
elif [ "$DATABASE_STORAGE" == "gcs" ]; then
GS_APPLICATION_CREDS="/var/run/secrets/deis/objectstore/creds/key.json"
GOOGLE_APPLICATION_CREDENTIALS="/var/run/secrets/deis/objectstore/creds/key.json"
BUCKET_NAME=$(cat /var/run/secrets/deis/objectstore/creds/database-bucket)
echo "gs://$BUCKET_NAME" > WALE_GS_PREFIX
echo $GS_APPLICATION_CREDS > GS_APPLICATION_CREDS
echo $GOOGLE_APPLICATION_CREDENTIALS > GOOGLE_APPLICATION_CREDENTIALS
echo $BUCKET_NAME > BUCKET_NAME
elif [ "$DATABASE_STORAGE" == "azure" ]; then
WABS_ACCOUNT_NAME=$(cat /var/run/secrets/deis/objectstore/creds/accountname)
Expand Down

0 comments on commit 3984d62

Please sign in to comment.