@@ -398,7 +398,13 @@ func createVM(ctx context.Context, scope *scope.MachineScope) (proxmox.VMCloneRe
398
398
templateMap := scope .ProxmoxMachine .GetTemplateMap ()
399
399
400
400
// set allowedNodes (we need to use this in scheduler and template search)
401
- allowedNodes := setAllowedNodes (scope )
401
+ // defaults to ProxmoxCluster allowedNodes
402
+ allowedNodes := scope .InfraCluster .ProxmoxCluster .Spec .AllowedNodes
403
+
404
+ // if ProxmoxMachine defines allowedNodes use them instead
405
+ if len (scope .ProxmoxMachine .Spec .AllowedNodes ) > 0 {
406
+ allowedNodes = scope .ProxmoxMachine .Spec .AllowedNodes
407
+ }
402
408
403
409
// TemplateSelector should be used
404
410
if templateMap == nil {
@@ -465,20 +471,6 @@ func createVM(ctx context.Context, scope *scope.MachineScope) (proxmox.VMCloneRe
465
471
return res , scope .InfraCluster .PatchObject ()
466
472
}
467
473
468
- // use ProxmoxCluster allowedNodes if ProxmoxMachine does not define them
469
- func setAllowedNodes (scope * scope.MachineScope ) []string {
470
-
471
- // defaults to ProxmoxCluster allowedNodes
472
- allowedNodes := scope .InfraCluster .ProxmoxCluster .Spec .AllowedNodes
473
-
474
- // if ProxmoxMachine defines allowedNodes use them instead
475
- if len (scope .ProxmoxMachine .Spec .AllowedNodes ) > 0 {
476
- allowedNodes = scope .ProxmoxMachine .Spec .AllowedNodes
477
- }
478
-
479
- return allowedNodes
480
- }
481
-
482
474
func getVMID (ctx context.Context , scope * scope.MachineScope ) (int64 , error ) {
483
475
if scope .ProxmoxMachine .Spec .VMIDRange != nil {
484
476
vmIDRangeStart := scope .ProxmoxMachine .Spec .VMIDRange .Start
0 commit comments