Commit e29771b9 authored by Roberto Bonafiglia's avatar Roberto Bonafiglia

Fixed client URL

parent dda409b0
......@@ -26,7 +26,10 @@ func Register(ctx context.Context, runtime *config.ControlRuntime, endpoints con
cl, err := etcd.GetClient(h.ctx, h.runtime, "https://127.0.0.1:2379")
if err != nil {
return err
cl, err = etcd.GetClient(h.ctx, h.runtime, "https://[::1]:2379")
if err != nil {
return err
}
}
h.etcdClient = cl
......
......@@ -460,9 +460,10 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
if ip == "" {
ip = "127.0.0.1"
if IPv6only {
ip = "[::1]"
ip = "::1"
}
} else if utilsnet.IsIPv6String(ip) {
}
if utilsnet.IsIPv6String(ip) {
ip = fmt.Sprintf("[%s]", ip)
}
......
......@@ -308,11 +308,9 @@ func genClientCerts(config *config.Control) error {
var certGen bool
IPv6OnlyService, _ := util.IsIPv6OnlyCIDRs(config.ServiceIPRanges)
ip := ""
ip := "127.0.0.1"
if IPv6OnlyService {
ip = "[::1]"
} else {
ip = "127.0.0.1"
}
apiEndpoint := fmt.Sprintf("https://%s:%d", ip, config.APIServerPort)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment