Fix host auth key format

This commit is contained in:
Bryce Lampe
2024-04-22 12:44:24 -07:00
parent 0f23201468
commit 7597ca32ca
2 changed files with 6 additions and 7 deletions

View File

@@ -81,6 +81,9 @@ func wrap(host *host, registries ...Registry) (*cli, error) {
auths := map[string]cfgtypes.AuthConfig{}
for k, v := range host.auths {
if k != config.DockerRegistryAuth {
k = credentials.ConvertToHostname(k)
}
auths[k] = cfgtypes.AuthConfig{
ServerAddress: v.ServerAddress,
Username: v.Username,
@@ -95,10 +98,6 @@ func wrap(host *host, registries ...Registry) (*cli, error) {
if key == "" {
key = h.Hostname
}
// Add a scheme if it's missing.
if !strings.Contains(key, "://") {
key = "https://" + key
}
auths[key] = cfgtypes.AuthConfig{
ServerAddress: h.Hostname,