mirror of https://github.com/k3s-io/k3s
Remove filtering of wildcard mirror entry
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>pull/9649/head
parent
84a071a81e
commit
b5a4846e9d
|
@ -30,8 +30,8 @@ func (c *Config) InjectMirror(nodeConfig *config.Node) error {
|
||||||
registry.Mirrors = map[string]registries.Mirror{}
|
registry.Mirrors = map[string]registries.Mirror{}
|
||||||
}
|
}
|
||||||
for host, mirror := range registry.Mirrors {
|
for host, mirror := range registry.Mirrors {
|
||||||
// Don't handle wildcard or local registry entries
|
// Don't handle local registry entries
|
||||||
if host != "*" && !docker.IsLocalhost(host) {
|
if !docker.IsLocalhost(host) {
|
||||||
mirror.Endpoints = append([]string{mirrorURL}, mirror.Endpoints...)
|
mirror.Endpoints = append([]string{mirrorURL}, mirror.Endpoints...)
|
||||||
registry.Mirrors[host] = mirror
|
registry.Mirrors[host] = mirror
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/containerd/containerd/remotes/docker"
|
||||||
"github.com/k3s-io/k3s/pkg/clientaccess"
|
"github.com/k3s-io/k3s/pkg/clientaccess"
|
||||||
"github.com/k3s-io/k3s/pkg/daemons/config"
|
"github.com/k3s-io/k3s/pkg/daemons/config"
|
||||||
"github.com/k3s-io/k3s/pkg/version"
|
"github.com/k3s-io/k3s/pkg/version"
|
||||||
|
@ -115,8 +116,8 @@ func (c *Config) Start(ctx context.Context, nodeConfig *config.Node) error {
|
||||||
urls := []url.URL{}
|
urls := []url.URL{}
|
||||||
registries := []string{}
|
registries := []string{}
|
||||||
for host := range nodeConfig.AgentConfig.Registry.Mirrors {
|
for host := range nodeConfig.AgentConfig.Registry.Mirrors {
|
||||||
if u, err := url.Parse("https://" + host); err != nil || host == "*" {
|
if u, err := url.Parse("https://" + host); err != nil || docker.IsLocalhost(host) {
|
||||||
logrus.Errorf("Distributed registry mirror skipping unsupported registry: %s", host)
|
logrus.Errorf("Distributed registry mirror skipping invalid registry: %s", host)
|
||||||
} else {
|
} else {
|
||||||
urls = append(urls, *u)
|
urls = append(urls, *u)
|
||||||
registries = append(registries, host)
|
registries = append(registries, host)
|
||||||
|
|
Loading…
Reference in New Issue