Add debug log message for resolving Docker credentials

What does this MR do?

Previously it was difficult to debug which Docker credentials were loaded and why if DOCKER_AUTH_CONFIG were specified.

This commit adds a debug message that shows which auth sources loaded from which config. For example:

Loaded Docker credentials, source = "$DOCKER_AUTH_CONFIG", hostnames = [public.ecr.aws 312968203986.dkr.ecr.us-west-2.amazonaws.com], error = <nil>  job=4000 project=2 runner=fz-mj8s9
Loaded Docker credentials, source = "/Users/stanhu/.docker/config.json", hostnames = [dev.gitlab.org:5005 registry.gitlab.com], error = <nil>  job=4000 project=2 runner=fz-mj8s9
Loaded Docker credentials, source = "job payload (GitLab Registry)", hostnames = [gitlab.example.com:5050 registry.gitlab.example.com:443], error = <nil>  job=4000 project=2 runner=fz-mj8s9
Authenticating with credentials from $DOCKER_AUTH_CONFIG  job=4000 project=2 runner=fz-mj8s9

Why was this MR needed?

Support had a difficult time debugging why DOCKER_AUTH_CONFIG was not working.

What's the best way to test this MR?

  1. In the config.toml, add log_level = "debug".
  2. In a project CI/CD varaible, add DOCKER_AUTH_CONFIG variable:
{ 
  "credsStore": "ecr-login"
}
  1. Run the job. See the Loaded Docker credentials messages.

What are the relevant issue numbers?

Edited by Stan Hu

Merge request reports

Loading
Loading