Skip to content

Commit

Permalink
Merge pull request #212 from detiber/quickfix
Browse files Browse the repository at this point in the history
🐛 Fix error handling on Machine creation
  • Loading branch information
k8s-ci-robot committed Dec 7, 2020
2 parents cc2c7d3 + b674928 commit 630833c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion controllers/packetmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (r *PacketMachineReconciler) reconcile(ctx context.Context, machineScope *s

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

0 comments on commit 630833c

Please sign in to comment.