Skip to content

Commit

Permalink
Use JoinPath to construct vSphere url (#1741)
Browse files Browse the repository at this point in the history
Signed-off-by: Marvin Beckers <marvin@kubermatic.com>
Co-authored-by: Marvin Beckers <marvin@kubermatic.com>
  • Loading branch information
kubermatic-bot and embik committed Dec 12, 2023
1 parent 1fda1ad commit 91f9179
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/cloudprovider/provider/vsphere/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 91f9179

Please sign in to comment.