Azure / acr-builder

Azure Container Registry Build Runner
MIT License
38 stars 35 forks source link

The error message is misleading if identity doesn't have permission on the registry #613

Closed northtyphoon closed 2 years ago

northtyphoon commented 2 years ago

If the identity doesn't have the permission to access the registry, the code will display the following error message

failed to login, ran out of retries: failed to set docker credentials: Error: Cannot perform an interactive login from a non TTY device

It's because current code didn't check the response status code of ACR exchange api. The code ends up passing an empty password string to docker login command.

https://github.com/Azure/acr-builder/blob/c94aeab189108160b2c60554cd82b63a1010e4bc/tokenutil/token_util.go#L54