mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Fixed client URL
Signed-off-by: Roberto Bonafiglia <roberto.bonafiglia@suse.com>
This commit is contained in:
parent
dda409b041
commit
e29771b9ff
@ -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")
|
cl, err := etcd.GetClient(h.ctx, h.runtime, "https://127.0.0.1:2379")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
cl, err = etcd.GetClient(h.ctx, h.runtime, "https://[::1]:2379")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
h.etcdClient = cl
|
h.etcdClient = cl
|
||||||
|
|
||||||
|
@ -460,9 +460,10 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
|
|||||||
if ip == "" {
|
if ip == "" {
|
||||||
ip = "127.0.0.1"
|
ip = "127.0.0.1"
|
||||||
if IPv6only {
|
if IPv6only {
|
||||||
ip = "[::1]"
|
ip = "::1"
|
||||||
}
|
}
|
||||||
} else if utilsnet.IsIPv6String(ip) {
|
}
|
||||||
|
if utilsnet.IsIPv6String(ip) {
|
||||||
ip = fmt.Sprintf("[%s]", ip)
|
ip = fmt.Sprintf("[%s]", ip)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,11 +308,9 @@ func genClientCerts(config *config.Control) error {
|
|||||||
var certGen bool
|
var certGen bool
|
||||||
|
|
||||||
IPv6OnlyService, _ := util.IsIPv6OnlyCIDRs(config.ServiceIPRanges)
|
IPv6OnlyService, _ := util.IsIPv6OnlyCIDRs(config.ServiceIPRanges)
|
||||||
ip := ""
|
ip := "127.0.0.1"
|
||||||
if IPv6OnlyService {
|
if IPv6OnlyService {
|
||||||
ip = "[::1]"
|
ip = "[::1]"
|
||||||
} else {
|
|
||||||
ip = "127.0.0.1"
|
|
||||||
}
|
}
|
||||||
apiEndpoint := fmt.Sprintf("https://%s:%d", ip, config.APIServerPort)
|
apiEndpoint := fmt.Sprintf("https://%s:%d", ip, config.APIServerPort)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user