medik8s / fence-agents-remediation

Kubernetes Operator for providing high availability between nodes by automatically remediating them using well-known fence-agents.
https://www.medik8s.io/
Apache License 2.0
9 stars 8 forks source link

Improve Logs from Updating Conditions #117

Closed razo7 closed 10 months ago

razo7 commented 10 months ago

The UpdateConditions function has an error only when an unknown agent has been found. Thus, there is no need to return and check it from reconcile, since it is not an error from trying to update it. FAR can simply log an informative error when it was called when unknown ConditionsChangeReason. Moreover, the lastTrinsitionTime print is more human friendly

openshift-ci[bot] commented 10 months ago

Skipping CI for Draft Pull Request. If you want CI signal for your change, please convert it to an actual PR. You can still manually trigger a test run with /test all

razo7 commented 10 months ago

/test 4.14-openshift-e2e /test 4.15-openshift-e2e

razo7 commented 10 months ago

/test 4.14-openshift-e2e /test 4.15-openshift-e2e

mshitrit commented 10 months ago

/lgtm

razo7 commented 10 months ago

/retest

razo7 commented 10 months ago

/retest

razo7 commented 10 months ago

I wonder if all the error messages after UpdateStatus failures could be put inside UpdateStatus function itself.

They can but this way we log an error in the function and Reconcile

clobrano commented 10 months ago

I wonder if all the error messages after UpdateStatus failures could be put inside UpdateStatus function itself.

They can but this way we log an error in the function and Reconcile

Sorry, I meant inside utils.UpdateConditions.

IIUC the additional information this new logs provide is the CR's name, which is already accessible inside utils.UpdateConditions, so we could simply update the error logs that are inside utils.UpdateConditions

razo7 commented 10 months ago

SGTM

openshift-ci[bot] commented 10 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: clobrano, razo7

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: - ~~[OWNERS](https://github.com/medik8s/fence-agents-remediation/blob/main/OWNERS)~~ [clobrano,razo7] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
razo7 commented 10 months ago

/retest