Skip to content

Commit 0044f9b

Browse files
nitrocbsmira
authored andcommitted
fix: use net.JoinHostPort for control plane endpoint URL
This is necessary to allow IPv6 addresses Signed-off-by: Christian Bendieck <[email protected]> Signed-off-by: Andrey Smirnov <[email protected]>
1 parent e135465 commit 0044f9b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

controllers/talosconfig_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"encoding/json"
1010
"errors"
1111
"fmt"
12+
"net"
1213
"strconv"
1314
"strings"
1415
"time"
@@ -512,7 +513,7 @@ func (r *TalosConfigReconciler) genConfigs(ctx context.Context, scope *TalosConf
512513

513514
input, err := generate.NewInput(
514515
scope.Cluster.Name,
515-
"https://"+scope.Cluster.Spec.ControlPlaneEndpoint.Host+":"+APIEndpointPort,
516+
"https://"+net.JoinHostPort(scope.Cluster.Spec.ControlPlaneEndpoint.Host, APIEndpointPort),
516517
k8sVersion,
517518
genOptions...,
518519
)

0 commit comments

Comments
 (0)