-
Notifications
You must be signed in to change notification settings - Fork 559
Description
What happened?
Under the right conditions, the CLI will spit an error and fail to connect to a vcluster:
fatal unexpected server in kubeconfig:
https://example.com
What did you expect to happen?
vcluster connect to replace the hostname correctly.
How can we reproduce it (as minimally and precisely as possible)?
To repro: do not have docker installed, have a vcluster hostname that does not specify the port. Run vcluster connect
In pkg/cli/connect_helm.go L343-195 there is logic that handles processing the hostname.
If docker is not available, the hostname provided in the secret is parsed.
An error is raised if the server name is not split into 3 portions.
That's because the server name is assumed to specify the port.
So https://example.com:443 is valid but https://example.com is not.
I believe this should be modified:
If len of splitted == 3: port = splitted[2]
If len of splitted == 2: port = 443
Anything else we need to know?
No response
Host cluster Kubernetes version
Client Version: v1.34.3
Kustomize Version: v5.7.1
Server Version: v1.34.2-eks-b3126f4
vcluster version
vcluster version 0.30.2 (validated that this is current as of 4abf19a)
VCluster Config
N/A