Skip to content

Commit

Permalink
Merge pull request #59 from yuvipanda/fixes
Browse files Browse the repository at this point in the history
Ensure `credHelpers` key exists in ~/.docker/config.json
  • Loading branch information
yuvipanda committed Mar 27, 2020
2 parents 63c668d + 1b57576 commit 5071b96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hubploy/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,9 @@ def registry_auth_aws(deployment, project, zone, service_key):
with open(docker_config, 'r') as f:
config = json.load(f)
else:
config = {'credHelpers': {}}
config['credHelpers'][registry] = 'ecr-login'
config = {}

config.setdefault('credHelpers', {})[registry] = 'ecr-login'
with open(docker_config, 'w') as f:
json.dump(config, f)

Expand Down

0 comments on commit 5071b96

Please sign in to comment.