From 91f9179cf31af5c8531daf618eb91c27bfbddf63 Mon Sep 17 00:00:00 2001 From: Kubermatic Bot <41968677+kubermatic-bot@users.noreply.github.com> Date: Tue, 12 Dec 2023 08:04:06 +0100 Subject: [PATCH] Use JoinPath to construct vSphere url (#1741) Signed-off-by: Marvin Beckers Co-authored-by: Marvin Beckers --- pkg/cloudprovider/provider/vsphere/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/cloudprovider/provider/vsphere/client.go b/pkg/cloudprovider/provider/vsphere/client.go index f89f9c0e0..4a2e688eb 100644 --- a/pkg/cloudprovider/provider/vsphere/client.go +++ b/pkg/cloudprovider/provider/vsphere/client.go @@ -109,11 +109,13 @@ func (s *RESTSession) Logout(ctx context.Context) { } func createVim25Client(ctx context.Context, config *Config) (*vim25.Client, error) { - clientURL, err := url.Parse(fmt.Sprintf("%s/sdk", config.VSphereURL)) + endpointURL, err := url.Parse(config.VSphereURL) if err != nil { return nil, err } + clientURL := endpointURL.JoinPath("/sdk") + // creating the govmoni Client in roundabout way because we need to set the proper CA bundle: reference https://github.com/vmware/govmomi/issues/1200 soapClient := soap.NewClient(clientURL, config.AllowInsecure) // set our CA bundle