Skip to content

Commit

Permalink
Don't register embedded registry address as an upstream registry
Browse files Browse the repository at this point in the history
Signed-off-by: Brad Davidson <[email protected]>
  • Loading branch information
brandond committed Mar 1, 2024
1 parent 9c8b07a commit 59f98a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/spegel/spegel.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,15 @@ func init() {

// Start starts the embedded p2p router, and binds the registry API to an existing HTTP router.
func (c *Config) Start(ctx context.Context, nodeConfig *config.Node) error {
localAddr := net.JoinHostPort(c.InternalAddress, c.RegistryPort)
// distribute images for all configured mirrors. there doesn't need to be a
// configured endpoint, just having a key for the registry will do.
urls := []url.URL{}
registries := []string{}
for host := range nodeConfig.AgentConfig.Registry.Mirrors {
if u, err := url.Parse("https://" + host); err != nil {
logrus.Errorf("Distributed registry mirror skipping invalid registry: %s", host)
} else {
} else if u.Host != localAddr {
urls = append(urls, *u)
registries = append(registries, host)
}
Expand Down Expand Up @@ -209,7 +210,6 @@ func (c *Config) Start(ctx context.Context, nodeConfig *config.Node) error {
if err != nil {
return errors.Wrap(err, "failed to read server CA")
}
localAddr := net.JoinHostPort(c.InternalAddress, c.RegistryPort)
client := clientaccess.GetHTTPClient(caCert, c.ClientCertFile, c.ClientKeyFile)
metrics.Register()
registryOpts := []registry.Option{
Expand Down

0 comments on commit 59f98a2

Please sign in to comment.