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

Re-init conditions each reconcile #177

Merged

Conversation

mrkisaolamb
Copy link
Contributor

Jira: OSPRH-5698

@mrkisaolamb mrkisaolamb requested a review from gibizer March 21, 2024 13:25
@openshift-ci openshift-ci bot requested review from dprince and viroel March 21, 2024 13:25
Copy link
Contributor

@bogdando bogdando left a comment

Choose a reason for hiding this comment

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

lgtm

condition.InitReason,
condition.InputReadyInitMessage),
)
instance.Status.Conditions = condition.Conditions{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO this will not give us anything (exept that some conditions with status unknown will keep old LastTransitionTime) but we can change this too be consistent

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree it seems there is no need for nil checks

Copy link
Collaborator

Choose a reason for hiding this comment

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

So as far as I see instance.Status.Conditions.Init(&cl) is smart and it updates existing conditions only if there was status change.

However instance.Status.Conditions = condition.Conditions{} blows away the previous list of conditions in the Status. So I think I see why cinder did this only once but calls Init unconditionally.

With this PR a later reconcile:

  • deletes the previous condition list
  • creates a new condition list with unknown state (no last transition time)
  • do the reconciliation and set condition states (conditions with updated state get a transition time)

Cinder's solution:

  • keeps the previous condition list
  • sets all condition state to Unknown in the list. (If the state wasn't unknown before then this updates the last transition time)
  • do the reconciliation and set condition states accordingly (conditions with updated state get a transition time)

So basically both solutions make the last transition time of non Unknown conditions useless as both solution will reset that field at each reconciliation.

Also both solutions are noisy at the end as a later reconciliaton overwrites the transition time of the conditions in the API.

I will bring up loosing the last transition time issue on slack.

Copy link
Contributor

@bogdando bogdando left a comment

Choose a reason for hiding this comment

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

some minor concern

Copy link
Contributor

@bogdando bogdando left a comment

Choose a reason for hiding this comment

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

lgtm

@mrkisaolamb mrkisaolamb force-pushed the reinit branch 2 times, most recently from 3743fbf to bfd0ff8 Compare March 26, 2024 11:02
@mrkisaolamb
Copy link
Contributor Author

/retest

Copy link
Collaborator

@gibizer gibizer left a comment

Choose a reason for hiding this comment

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

API def looks good and the the implementation in sync with the rest of the services. We will improve the impl later separately

Copy link
Contributor

openshift-ci bot commented Apr 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gibizer, mrkisaolamb

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 [gibizer,mrkisaolamb]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gibizer
Copy link
Collaborator

gibizer commented Apr 3, 2024

/test placement-operator-build-deploy-kuttl

@openshift-merge-bot openshift-merge-bot bot merged commit c710647 into openstack-k8s-operators:main Apr 3, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants