After @tmaczukin review

Maintainer
parent ca9bb8c3
......@@ -319,7 +319,8 @@ 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:
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
{
......
......@@ -114,42 +114,33 @@ 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
}
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 addAll(to, from map[string]types.AuthConfig) {
for reg, ac := range from {
to[reg] = ac
......
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