Skip to content

Commit

Permalink
fix: Set listall on listVirtualMachine calls so we search all VMs in …
Browse files Browse the repository at this point in the history
…the domain

This is mainly useful when the API credentials used by the CSI driver are from a different domain user than the user that created the VMs.
  • Loading branch information
hrak committed Aug 20, 2024
1 parent 66d0027 commit 1cf17e1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/cloud/vms.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ func (c *client) GetVMByID(ctx context.Context, vmID string) (*VM, error) {
logger := klog.FromContext(ctx)
p := c.VirtualMachine.NewListVirtualMachinesParams()
p.SetId(vmID)
p.SetListall(true)
if c.projectID != "" {
p.SetProjectid(c.projectID)
}
Expand Down Expand Up @@ -38,6 +39,7 @@ func (c *client) getVMByName(ctx context.Context, name string) (*VM, error) {
logger := klog.FromContext(ctx)
p := c.VirtualMachine.NewListVirtualMachinesParams()
p.SetName(name)
p.SetListall(true)
if c.projectID != "" {
p.SetProjectid(c.projectID)
}
Expand Down

0 comments on commit 1cf17e1

Please sign in to comment.