From 074221ba54c1c432dd03413c366e150eb221e5f4 Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Fri, 14 Jun 2024 16:11:20 -0400 Subject: [PATCH] fix: update searchPath Updates `searchPath` to use `path` instead of `filepath` since this is a vSphere inventory path (e.g., `\Datacenter\vm\`), not a directory path. Ref: #2166 Signed-off-by: Ryan Johnson --- vsphere/resource_vsphere_virtual_machine.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vsphere/resource_vsphere_virtual_machine.go b/vsphere/resource_vsphere_virtual_machine.go index a93df611c..e21598e7c 100644 --- a/vsphere/resource_vsphere_virtual_machine.go +++ b/vsphere/resource_vsphere_virtual_machine.go @@ -10,7 +10,7 @@ import ( "log" "net" "os" - "path/filepath" + "path" "strings" "time" @@ -1405,7 +1405,7 @@ func resourceVsphereMachineDeployOvfAndOva(d *schema.ResourceData, meta interfac } searchPath := ovfHelper.Name if ovfHelper.Folder != nil && len(ovfHelper.Folder.InventoryPath) > 0 { - searchPath = filepath.Join(ovfHelper.Folder.InventoryPath, searchPath) + searchPath = path.Join(ovfHelper.Folder.InventoryPath, searchPath) } vm, err := virtualmachine.FromPath(client, searchPath, datacenterObj) if err != nil {