Skip to content

Conversation

andmat900
Copy link
Contributor

Applicable Issues

Description of the Change

This change introduces a new scheduling logic for provider health checks. The health checks are scheduled dynamically based on the provider's health check interval setting and the previous health check result.

Alternate Designs

Possible Drawbacks

Sign-off

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

Signed-off-by: Andrei Matveyeu, andrei.matveyeu@axis.com

@andmat900 andmat900 requested a review from a team as a code owner December 18, 2024 15:32
@andmat900 andmat900 requested review from t-persson and fredjn and removed request for a team December 18, 2024 15:32
@andmat900 andmat900 force-pushed the 20241218_scheduled_checks_simplified branch from 77bcca5 to 75934d7 Compare December 19, 2024 13:18
return ctrl.Result{}, err
}

meta.SetStatusCondition(&provider.Status.Conditions, metav1.Condition{Type: StatusAvailable, Status: metav1.ConditionTrue, Reason: "OK", Message: "Provider is up and running"})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just doing SetStatusCondition does nothing, r.Status().Update(...) must be called for it to write the status back on the resource.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SetStatusCondition now placed before r.Status().Update().

if time.Until(next) > 0 {
return ctrl.Result{RequeueAfter: time.Until(next)}, nil
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should set LastHealthCheckTime on the provider resource here at the start, so that we have it set even on failures.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LastHealthCheckTime placed in the beginning of the function.

@andmat900 andmat900 merged commit bcc3747 into eiffel-community:main Jan 20, 2025
andmat900 added a commit to andmat900/etos that referenced this pull request Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants