resolveAuthConfig returns auth-config for the given registry from the credential-store. It returns an empty AuthConfig if no credentials were found. It is similar to [registry.ResolveAuthConfig], but uses the credentials- store, instead of looking up credentials from a map. [registry.ResolveAuthCo
(cfg *configfile.ConfigFile, index *registrytypes.IndexInfo)
| 192 | // |
| 193 | // [registry.ResolveAuthConfig]: https://pkg.go.dev/github.com/docker/docker@v28.3.3+incompatible/registry#ResolveAuthConfig |
| 194 | func resolveAuthConfig(cfg *configfile.ConfigFile, index *registrytypes.IndexInfo) registrytypes.AuthConfig { |
| 195 | configKey := index.Name |
| 196 | if index.Official { |
| 197 | configKey = authConfigKey |
| 198 | } |
| 199 | |
| 200 | a, _ := cfg.GetAuthConfig(configKey) |
| 201 | return registrytypes.AuthConfig{ |
| 202 | Username: a.Username, |
| 203 | Password: a.Password, |
| 204 | ServerAddress: a.ServerAddress, |
| 205 | |
| 206 | // TODO(thaJeztah): Are these expected to be included? |
| 207 | Auth: a.Auth, |
| 208 | IdentityToken: a.IdentityToken, |
| 209 | RegistryToken: a.RegistryToken, |
| 210 | } |
| 211 | } |
no test coverage detected
searching dependent graphs…