Skip to content

Commit

Permalink
Add vSphere host vm group zonal
Browse files Browse the repository at this point in the history
  • Loading branch information
jcpowermac committed Sep 27, 2024
1 parent 2553a99 commit 45f262b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ import (

"github.com/go-logr/logr"
"github.com/go-test/deep"
"k8s.io/apimachinery/pkg/runtime"

configv1 "github.com/openshift/api/config/v1"
machinev1 "github.com/openshift/api/machine/v1"
machinev1beta1 "github.com/openshift/api/machine/v1beta1"
"k8s.io/apimachinery/pkg/runtime"
)

// VSphereProviderConfig holds the provider spec of a VSphere Machine.
Expand Down Expand Up @@ -81,6 +82,10 @@ func (v VSphereProviderConfig) getWorkspaceFromFailureDomain(failureDomain *conf
workspace.Folder = fmt.Sprintf("/%s/vm/%s", workspace.Datacenter, v.infrastructure.Status.InfrastructureName)
}

if len(topology.AffinityGroup.VMGroup) > 0 {
workspace.VMGroup = topology.AffinityGroup.VMGroup
}

return workspace
}

Expand Down Expand Up @@ -175,6 +180,7 @@ func (v VSphereProviderConfig) ExtractFailureDomain() machinev1.VSphereFailureDo
if workspace.Datacenter == topology.Datacenter &&
workspace.Datastore == topology.Datastore &&
workspace.Server == failureDomain.Server &&
workspace.VMGroup == topology.AffinityGroup.VMGroup &&
path.Clean(workspace.ResourcePool) == path.Clean(topology.ResourcePool) {
return machinev1.VSphereFailureDomain{
Name: failureDomain.Name,
Expand Down

0 comments on commit 45f262b

Please sign in to comment.