After review commit

parent dbfa7773
......@@ -319,19 +319,6 @@ you can set the authorization configuration in the `DOCKER_AUTH_CONFIG`
[variable]. It can be set in both GitLab Variables section of
a project and in the `config.toml` file.
Docker credentials helper can be configured using `config.json` file in `.docker` folder
in runner's home directory, if you are using self hosted runners:
```json
{
"credHelpers": {
"aws_account_id.dkr.ecr.region-1.amazonaws.com": "ecr-login",
"aws_account_id.dkr.ecr.region-2.amazonaws.com": "ecr-login",
"gcr.io": "gcr"
}
}
```
For a detailed example, visit the [Using Docker images documentation][priv-example].
The steps performed by the Runner can be summed up to:
......
......@@ -114,30 +114,34 @@ func ReadAuthConfigsFromReader(r io.Reader) (map[string]types.AuthConfig, error)
}
addAll(auths, authsFromCredentialsHelpers)
}
return auths, nil
}
func readAuthConfigsFromCredentialsStore(config *configfile.ConfigFile) (map[string]types.AuthConfig, error) {
store := credentials.NewNativeStore(config, config.CredentialsStore)
newAuths, err := store.GetAll()
if err != nil {
return nil, err
}
return newAuths, nil
}
func readAuthConfigsFromCredentialsHelper(config *configfile.ConfigFile) (map[string]types.AuthConfig, error) {
helpersAuths := make(map[string]types.AuthConfig)
for registry, helper := range config.CredentialHelpers {
store := credentials.NewNativeStore(config, helper)
newAuths, err := store.Get(registry)
if err != nil {
return nil, err
}
helpersAuths[registry] = newAuths
}
return helpersAuths, nil
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment