My suggestion is to add an extra check, as such (after L120 check):
if !strings.HasPrefix(folderPath, fi.datacenterPath(ctx, datacenter)) {
c.logger.Debugf("Discovered a DC folder, adding it tot he begining of the path")
// ADD IT TO THE BEGINNING OF THE PATH
}
I am not sure that datacenterPath will return the entire root path, with DC folder.
Going a little deeper, FindFolder seems to be the right place to run any changes since createvm.go also uses it to recover VMs' RootVMFolder before running the actual creation command: /github. com/juju/ juju/blob/ develop/ provider/ vsphere/ internal/ vsphereclient/ createvm. go#L319
https:/
It seems govmomi is not returning the entire absolute path with: /github. com/juju/ juju/blob/ develop/ provider/ vsphere/ internal/ vsphereclient/ client. go#L120
https:/
My suggestion is to add an extra check, as such (after L120 check): HasPrefix( folderPath, fi.datacenterPa th(ctx, datacenter)) { Debugf( "Discovered a DC folder, adding it tot he begining of the path")
if !strings.
c.logger.
// ADD IT TO THE BEGINNING OF THE PATH
}
I am not sure that datacenterPath will return the entire root path, with DC folder.