-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Do not treat lack of reservations as a fatal error #206
Conversation
errs := fmt.Errorf("failed to create machine %s: %v", machineScope.Name(), err) | ||
|
||
switch { | ||
// TODO: find a better way than parsing the error messages for this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not overly happy with this approach, but I wasn't able to find a unique error code that we could match against and this substring appears to be unique from the API for this error. This is the same approach taken in the autoscaler integration: https://github.com/kubernetes/autoscaler/pull/3483/files#diff-364a854e7bf33e867868548a8220972f41ca9cd66260a875d728f20c9500a13cR559-R562
@@ -280,10 +287,7 @@ func (r *PacketMachineReconciler) reconcile(ctx context.Context, machineScope *s | |||
Address: controlPlaneEndpoint.Address, | |||
}); err != nil { | |||
r.Log.Error(err, "err assigining elastic ip to control plane. retrying...") | |||
return ctrl.Result{ | |||
Requeue: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requeue: true
overrides the RequeueAfter
time set below it
/assign @gianarb |
/approve Well done! @jhead-slg this should keep the machine creation going if the returned error is "not enough reservation". In this way, the process will keep trying until one shows up. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: detiber, gianarb The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
Prevents the PacketMachine controller from treating an error indicating a lack of reservations as a fatal error, this allows the controller to continue to retry instance creation until a reservation is available.