@@ -53,9 +53,9 @@ const (
53
53
)
54
54
55
55
var (
56
- ErrMissingDevice = errors .New ("machine does not exist" )
57
- ErrFacilityMatch = errors .New ("instance facility does not match machine facility" )
58
- ErrMetroMatch = errors .New ("instance metro does not match machine metro" )
56
+ errMissingDevice = errors .New ("machine does not exist" )
57
+ errFacilityMatch = errors .New ("instance facility does not match machine facility" )
58
+ errMetroMatch = errors .New ("instance metro does not match machine metro" )
59
59
)
60
60
61
61
// PacketMachineReconciler reconciles a PacketMachine object
@@ -425,11 +425,11 @@ func (r *PacketMachineReconciler) reconcile(ctx context.Context, machineScope *s
425
425
deviceMetro := dev .Metro .Code
426
426
427
427
if machineScope .PacketMachine .Spec .Facility != "" && machineScope .PacketMachine .Spec .Facility != * deviceFacility {
428
- return ctrl.Result {}, fmt .Errorf ("%w: %s != %s" , ErrFacilityMatch , machineScope .PacketMachine .Spec .Facility , * deviceFacility )
428
+ return ctrl.Result {}, fmt .Errorf ("%w: %s != %s" , errFacilityMatch , machineScope .PacketMachine .Spec .Facility , * deviceFacility )
429
429
}
430
430
431
431
if machineScope .PacketMachine .Spec .Metro != "" && machineScope .PacketMachine .Spec .Metro != * deviceMetro {
432
- return ctrl.Result {}, fmt .Errorf ("%w: %s != %s" , ErrMetroMatch , machineScope .PacketMachine .Spec .Facility , * deviceMetro )
432
+ return ctrl.Result {}, fmt .Errorf ("%w: %s != %s" , errMetroMatch , machineScope .PacketMachine .Spec .Facility , * deviceMetro )
433
433
}
434
434
435
435
return result , nil
@@ -494,7 +494,7 @@ func (r *PacketMachineReconciler) reconcileDelete(ctx context.Context, machineSc
494
494
// We should never get there but this is a safetly check
495
495
if device == nil {
496
496
controllerutil .RemoveFinalizer (packetmachine , infrav1 .MachineFinalizer )
497
- return ctrl. Result {}, fmt .Errorf ("%w: %s" , ErrMissingDevice , packetmachine .Name )
497
+ return fmt .Errorf ("%w: %s" , errMissingDevice , packetmachine .Name )
498
498
}
499
499
500
500
apiRequest := r .PacketClient .DevicesApi .DeleteDevice (ctx , device .GetId ()).ForceDelete (force )
0 commit comments