(cfg *configfile.ConfigFile, authConfig registrytypes.AuthConfig)
| 320 | } |
| 321 | |
| 322 | func storeCredentials(cfg *configfile.ConfigFile, authConfig registrytypes.AuthConfig) error { |
| 323 | creds := cfg.GetCredentialsStore(authConfig.ServerAddress) |
| 324 | if err := creds.Store(configtypes.AuthConfig{ |
| 325 | Username: authConfig.Username, |
| 326 | Password: authConfig.Password, |
| 327 | ServerAddress: authConfig.ServerAddress, |
| 328 | |
| 329 | // TODO(thaJeztah): Are these expected to be included? |
| 330 | Auth: authConfig.Auth, |
| 331 | IdentityToken: authConfig.IdentityToken, |
| 332 | RegistryToken: authConfig.RegistryToken, |
| 333 | }); err != nil { |
| 334 | return fmt.Errorf("error saving credentials: %v", err) |
| 335 | } |
| 336 | |
| 337 | return nil |
| 338 | } |
| 339 | |
| 340 | func loginWithRegistry(ctx context.Context, apiClient client.SystemAPIClient, options client.RegistryLoginOptions) (client.RegistryLoginResult, error) { |
| 341 | res, err := apiClient.RegistryLogin(ctx, options) |
no test coverage detected
searching dependent graphs…