mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Remove filtering of wildcard mirror entry
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
parent
84a071a81e
commit
b5a4846e9d
@ -30,8 +30,8 @@ func (c *Config) InjectMirror(nodeConfig *config.Node) error {
|
||||
registry.Mirrors = map[string]registries.Mirror{}
|
||||
}
|
||||
for host, mirror := range registry.Mirrors {
|
||||
// Don't handle wildcard or local registry entries
|
||||
if host != "*" && !docker.IsLocalhost(host) {
|
||||
// Don't handle local registry entries
|
||||
if !docker.IsLocalhost(host) {
|
||||
mirror.Endpoints = append([]string{mirrorURL}, mirror.Endpoints...)
|
||||
registry.Mirrors[host] = mirror
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/containerd/containerd/remotes/docker"
|
||||
"github.com/k3s-io/k3s/pkg/clientaccess"
|
||||
"github.com/k3s-io/k3s/pkg/daemons/config"
|
||||
"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{}
|
||||
registries := []string{}
|
||||
for host := range nodeConfig.AgentConfig.Registry.Mirrors {
|
||||
if u, err := url.Parse("https://" + host); err != nil || host == "*" {
|
||||
logrus.Errorf("Distributed registry mirror skipping unsupported registry: %s", host)
|
||||
if u, err := url.Parse("https://" + host); err != nil || docker.IsLocalhost(host) {
|
||||
logrus.Errorf("Distributed registry mirror skipping invalid registry: %s", host)
|
||||
} else {
|
||||
urls = append(urls, *u)
|
||||
registries = append(registries, host)
|
||||
|
Loading…
Reference in New Issue
Block a user