Skip to content
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

Merged
merged 2 commits into from
Nov 25, 2020

Conversation

detiber
Copy link
Member

@detiber detiber commented Nov 25, 2020

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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 25, 2020
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 25, 2020
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.
Copy link
Member Author

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,
Copy link
Member Author

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

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 25, 2020
@detiber
Copy link
Member Author

detiber commented Nov 25, 2020

/assign @gianarb

@gianarb
Copy link
Contributor

gianarb commented Nov 25, 2020

/approve
/lgtm

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.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 25, 2020
@k8s-ci-robot k8s-ci-robot merged commit 6111559 into kubernetes-sigs:master Nov 25, 2020
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@detiber detiber deleted the errReserved branch November 25, 2020 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants