Skip to content

Commit 6113528

Browse files
committed
fix(build, buildah): prefix registries mirrors with https
Signed-off-by: Ilya Lesikov <ilya@lesikov.com>
1 parent 1dffdb4 commit 6113528

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/docker_registry/generic_api.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"net/url"
7+
"strings"
78
"sync"
89

910
"github.com/google/go-containerregistry/pkg/name"
@@ -143,7 +144,14 @@ func (api *genericApi) getOrCreateRegistryMirrors(ctx context.Context) ([]string
143144
}
144145

145146
mirrorsFromEnv := util.PredefinedValuesByEnvNamePrefix("WERF_CONTAINER_REGISTRY_MIRROR_")
146-
mirrors = append(mirrors, mirrorsFromEnv...)
147+
148+
for _, mirror := range mirrorsFromEnv {
149+
if !strings.HasPrefix("http://", mirror) && !strings.HasPrefix("https://", mirror) {
150+
mirror = "https://" + mirror
151+
}
152+
153+
mirrors = append(mirrors, mirror)
154+
}
147155

148156
api.mirrors = &mirrors
149157
}

0 commit comments

Comments
 (0)