1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 06:46:36 +01:00

Merge pull request #8912 from openshift-cherrypick-robot/cherry-pick-8867-to-release-4.16

[release-4.16] OCPBUGS-39082: incorrect folder gen, workaround govmomi vm folder path bug
This commit is contained in:
openshift-merge-bot[bot]
2024-09-12 16:01:59 +00:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -39,12 +39,10 @@ func initializeFoldersAndTemplates(ctx context.Context, cachedImage string, fail
if err != nil {
return err
}
dcFolders, err := dc.Folders(ctx)
if err != nil {
return fmt.Errorf("unable to get datacenter folder: %w", err)
}
folderPath := path.Join(dcFolders.VmFolder.InventoryPath, clusterID)
// Upstream govmomi bug, workaround
// https://github.com/vmware/govmomi/issues/3523
folderPath := path.Join(dc.InventoryPath, "vm", clusterID)
// we must set the Folder to the infraId somewhere, we will need to remove that.
// if we are overwriting folderPath it needs to have a slash (path)

View File

@@ -5,6 +5,7 @@ import (
"path"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/vmware/govmomi/find"
"github.com/vmware/govmomi/object"
"sigs.k8s.io/cluster-api-provider-vsphere/pkg/session"
@@ -47,6 +48,7 @@ func createFolder(ctx context.Context, fullpath string, session *session.Session
}
if folder != nil && err == nil {
logrus.Debugf("creating folder %s in vcenter", base)
return folder.CreateFolder(ctx, base)
}
return folder, err