Use utf-8 & properly parse hostname from registry URL

This commit is contained in:
Christian M. Adams
2021-05-20 11:47:52 -04:00
parent 8316a1d198
commit cea6d8c3cb
3 changed files with 23 additions and 14 deletions

View File

@@ -842,7 +842,7 @@ class BaseTask(object):
username = cred.get_input('username')
password = cred.get_input('password')
token = "{}:{}".format(username, password)
auth_data = {'auths': {host: {'auth': b64encode(token.encode('ascii')).decode()}}}
auth_data = {'auths': {host: {'auth': b64encode(token.encode('UTF-8')).decode('UTF-8')}}}
authfile.write(json.dumps(auth_data, indent=4))
params["container_options"].append(f'--authfile={authfile.name}')
else: