lint: superfluous-else

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
Brad Davidson 2025-12-15 23:47:53 +00:00 committed by Brad Davidson
parent e416f10e3a
commit 83feb3c31d
2 changed files with 11 additions and 11 deletions

View file

@ -162,17 +162,17 @@ func getHostConfigs(registry *registries.Registry, noDefaultEndpoint bool, mirro
// create the default config, if it wasn't explicitly mentioned in the config section
config, ok := hosts[host]
if !ok {
if c, err := defaultHostConfig(host, mirrorAddr, configForHost(registry.Configs, host)); err != nil {
c, err := defaultHostConfig(host, mirrorAddr, configForHost(registry.Configs, host))
if err != nil {
logrus.Errorf("Failed to generate config for registry %s: %v", host, err)
continue
} else {
if noDefaultEndpoint {
c.Default = nil
} else if host == "*" {
c.Default = &templates.RegistryEndpoint{URL: &url.URL{}}
}
config = *c
}
if noDefaultEndpoint {
c.Default = nil
} else if host == "*" {
c.Default = &templates.RegistryEndpoint{URL: &url.URL{}}
}
config = *c
}
// track which endpoints we've already seen to avoid creating duplicates

View file

@ -34,11 +34,11 @@ func Register(ctx context.Context, serviceController corev1.ServiceController, e
rootlessClient, err = client.New(rootless.Sock)
if err == nil {
break
} else {
logrus.Infof("Waiting for rootless API socket %s: %v", rootless.Sock, err)
time.Sleep(1 * time.Second)
}
logrus.Infof("Waiting for rootless API socket %s: %v", rootless.Sock, err)
time.Sleep(1 * time.Second)
}
if err != nil {
return err
}