Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0513ce3

Browse files
authored
Merge branch 'master' into auto_consistency_fix
2 parents 7b7e2a0 + ec57e31 commit 0513ce3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

storage/kubernetes/client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,9 @@ func inClusterConfig() (cluster k8sapi.Cluster, user k8sapi.AuthInfo, namespace
415415
err = fmt.Errorf("unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined")
416416
return
417417
}
418+
// we need to wrap IPv6 addresses in square brackets
419+
// IPv4 also works with square brackets
420+
host = "[" + host + "]"
418421
cluster = k8sapi.Cluster{
419422
Server: "https://" + host + ":" + port,
420423
CertificateAuthority: "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt",

0 commit comments

Comments
 (0)