Skip to content

Commit

Permalink
Propagate datastore cluster for vSphere to cloud-config (#1695)
Browse files Browse the repository at this point in the history
Signed-off-by: Waleed Malik <[email protected]>
Co-authored-by: Waleed Malik <[email protected]>
  • Loading branch information
kubermatic-bot and ahmedwaleedmalik authored Jul 27, 2023
1 parent 79510a9 commit 33d4292
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/cloudprovider/provider/vsphere/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,11 @@ func (p *provider) GetCloudConfig(spec clusterv1alpha1.MachineSpec) (config stri
workingDir = fmt.Sprintf("/%s/vm", c.Datacenter)
}

datastore := c.Datastore
if datastore == "" {
datastore = c.DatastoreCluster
}

cc := &vspheretypes.CloudConfig{
Global: vspheretypes.GlobalOpts{
User: c.Username,
Expand All @@ -631,7 +636,7 @@ func (p *provider) GetCloudConfig(spec clusterv1alpha1.MachineSpec) (config stri
Workspace: vspheretypes.WorkspaceOpts{
Datacenter: c.Datacenter,
VCenterIP: u.Hostname(),
DefaultDatastore: c.Datastore,
DefaultDatastore: datastore,
Folder: workingDir,
},
VirtualCenter: map[string]*vspheretypes.VirtualCenterConfig{
Expand Down

0 comments on commit 33d4292

Please sign in to comment.