Skip to content

Commit

Permalink
Set failureMessage and failureReason when ErrNoVMIDInRangeFree is thrown
Browse files Browse the repository at this point in the history
  • Loading branch information
rybnico committed Dec 2, 2024
1 parent bdb6639 commit fcd858c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/service/vmservice/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ func getMachineAddresses(scope *scope.MachineScope) ([]clusterv1.MachineAddress,
func createVM(ctx context.Context, scope *scope.MachineScope) (proxmox.VMCloneResponse, error) {
vmid, err := getVMID(ctx, scope)
if err != nil {
if errors.Is(err, ErrNoVMIDInRangeFree) {
scope.SetFailureMessage(err)
scope.SetFailureReason(capierrors.InsufficientResourcesMachineError)
}
return proxmox.VMCloneResponse{}, err
}

Expand Down

0 comments on commit fcd858c

Please sign in to comment.