Skip to content

Commit

Permalink
fix(oci): Ensure auth data is not overwritten (#855)
Browse files Browse the repository at this point in the history
Reviewed-by: Jakub Ciolek <jakub@unikraft.io>
Approved-by: Jakub Ciolek <jakub@unikraft.io>
  • Loading branch information
jake-ciolek committed Oct 3, 2023
2 parents 11406a5 + 181f8f4 commit d59cd89
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions oci/manager_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,16 @@ func defaultAuths(ctx context.Context) (map[string]regtypes.AuthConfig, error) {

if cf != nil {
for domain, config := range cf.AuthConfigs {
auths[domain] = regtypes.AuthConfig{
Auth: config.Auth,
Email: config.Email,
IdentityToken: config.IdentityToken,
Password: config.Password,
RegistryToken: config.RegistryToken,
ServerAddress: config.ServerAddress,
Username: config.Username,
if _, ok := auths[domain]; !ok {
auths[domain] = regtypes.AuthConfig{
Auth: config.Auth,
Email: config.Email,
IdentityToken: config.IdentityToken,
Password: config.Password,
RegistryToken: config.RegistryToken,
ServerAddress: config.ServerAddress,
Username: config.Username,
}
}
}
}
Expand Down

0 comments on commit d59cd89

Please sign in to comment.