From 33d4292daf72a5794d264203f3b52c25e14517b8 Mon Sep 17 00:00:00 2001 From: Kubermatic Bot <41968677+kubermatic-bot@users.noreply.github.com> Date: Thu, 27 Jul 2023 13:54:53 +0200 Subject: [PATCH] Propagate datastore cluster for vSphere to cloud-config (#1695) Signed-off-by: Waleed Malik Co-authored-by: Waleed Malik --- pkg/cloudprovider/provider/vsphere/provider.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/cloudprovider/provider/vsphere/provider.go b/pkg/cloudprovider/provider/vsphere/provider.go index bf8b0f53b..93f9bf552 100644 --- a/pkg/cloudprovider/provider/vsphere/provider.go +++ b/pkg/cloudprovider/provider/vsphere/provider.go @@ -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, @@ -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{