openstack-k8s-operators / barbican-operator

Apache License 2.0
5 stars 24 forks source link

Re-init conditions each reconcile #111

Closed fmount closed 6 months ago

fmount commented 6 months ago

This patch follows the same pattern applied to the other operators, where we re-init the condition at each reconcile loop. Conditions are re-evaluated and updated, keeping the LastTransitionTime for those that haven't changed (it avoids the transition from True to Unknown to True again). In addition, the observedGeneration field is introduced, and it is used by the openstack-operator to check the IsReady() function for a particular CR in case a minor update is triggered. All the conditions are evaluated during the main Reconcile loop ( or the reconcileNormal function in some circumstances), hence the main ReadyCondition is updated within the same flow. The defer function still updates the Resource and Mirror(s) the condition to the top-level CR.

Jira: OSPRH-5919 Jira: OSPRH-5698

openshift-ci[bot] commented 6 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abays, fmount

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/openstack-k8s-operators/barbican-operator/blob/main/OWNERS)~~ [abays] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment