Skip to content

Commit

Permalink
Merge pull request #1412 from vmware/fix-vmc-enforcement
Browse files Browse the repository at this point in the history
While listing VMs, pass enforcement point param
  • Loading branch information
annakhm authored Oct 21, 2024
2 parents 719e14e + 9eed67e commit 53ed66f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nsxt/resource_nsxt_policy_vm_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ func listAllPolicyVirtualMachines(context utl.SessionContext, connector client.C
// parameters, respects cursor input. Therefore we determine end of VM list by
// looking for empty result.
sortBy := "external_id"
vms, err := client.List(cursor, nil, &boolFalse, nil, nil, &boolFalse, &sortBy)
var efPtr *string
if getPolicyEnforcementPoint(m) != "default" {
// To minimize changes, avoid passing enforcement point unless its specified in provider
enforcementPointPath := getPolicyEnforcementPointPath(m)
efPtr = &enforcementPointPath
}
vms, err := client.List(cursor, efPtr, &boolFalse, nil, nil, &boolFalse, &sortBy)
if err != nil {
return results, err
}
Expand Down

0 comments on commit 53ed66f

Please sign in to comment.