mirror of
https://github.com/outbackdingo/proxmox-cloud-controller-manager.git
synced 2026-01-27 10:20:13 +00:00
fix: cluster vm list
Fix the output to show the current number of VMs. Signed-off-by: Serge Logvinov <serge.logvinov@sinextra.dev>
This commit is contained in:
@@ -83,11 +83,16 @@ func (c *Cluster) CheckClusters(ctx context.Context) error {
|
||||
return fmt.Errorf("failed to initialized proxmox client in region %s, error: %v", region, err)
|
||||
}
|
||||
|
||||
vms, err := client.GetVmList(ctx)
|
||||
vmlist, err := client.GetVmList(ctx)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get list of VMs in region %s, error: %v", region, err)
|
||||
}
|
||||
|
||||
vms, ok := vmlist["data"].([]interface{})
|
||||
if !ok {
|
||||
return fmt.Errorf("failed to cast response to list of VMs in region %s, error: %v", region, err)
|
||||
}
|
||||
|
||||
if len(vms) > 0 {
|
||||
klog.V(4).InfoS("Proxmox cluster has VMs", "region", region, "count", len(vms))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user