Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit 630833c

Browse files
authored
Merge pull request #212 from detiber/quickfix
🐛 Fix error handling on Machine creation
2 parents cc2c7d3 + b674928 commit 630833c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

controllers/packetmachine_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func (r *PacketMachineReconciler) reconcile(ctx context.Context, machineScope *s
242242

243243
switch {
244244
// TODO: find a better way than parsing the error messages for this.
245-
case strings.Contains(err.Error(), " no available hardware reservations "):
245+
case err != nil && strings.Contains(err.Error(), " no available hardware reservations "):
246246
// Do not treat an error indicating there are no hardware reservations available as fatal
247247
return ctrl.Result{}, fmt.Errorf("failed to create machine %s: %w", machineScope.Name(), err)
248248
case err != nil:

0 commit comments

Comments
 (0)