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
@ -25,9 +25,12 @@ func Register(ctx context.Context, runtime *config.ControlRuntime, endpoints con
|
||||
endpoints.OnChange(ctx, version.Program+"-apiserver-lb-controller", h.sync)
|
||||
|
||||
cl, err := etcd.GetClient(h.ctx, h.runtime, "https://127.0.0.1:2379")
|
||||
if err != nil {
|
||||
cl, err = etcd.GetClient(h.ctx, h.runtime, "https://[::1]:2379")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
h.etcdClient = cl
|
||||
|
||||
go func() {
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user