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

fix(status): do not set Unknown back to component for every loop on reconcile #979

Merged
merged 2 commits into from
Apr 22, 2024

Conversation

zdtsw
Copy link
Member

@zdtsw zdtsw commented Apr 19, 2024

ref: https://issues.redhat.com/browse/RHOAIENG-415

Description

How Has This Been Tested?

local build quay.io/wenzhou/opendatahub-operator-catalog:v2.10.415-1

Merge criteria:

  • The commits are squashed in a cohesive manner and have meaningful messages.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work

@@ -278,13 +278,21 @@ func (r *DataScienceClusterReconciler) reconcileSubComponent(ctx context.Context
componentName := component.GetComponentName()

enabled := component.GetManagementState() == v1.Managed

isExistStatus := false
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably no need, you have assignment right below.

status.SetComponentCondition(&saved.Status.Conditions, componentName, status.ReconcileInit, message, corev1.ConditionUnknown)

// only set to init condition e.g Unknonw for the very first time when component is not in the list
if !isExistStatus {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the whole update is under the condition

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, the idea is to, only make this call, if we find the component in the installcomponents list,
it indicates if this is happening after upgrade operator or it is another new reconcile. so we can skip the Unknown showing after it is True or False

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, but should you skip UpdateWithRetry() call in this case at all?

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, i see your point.

- init is only set for the very first time
- after that component not in the installed list then use Unknown
- otherwise, even it is not installed it has gone thro once so True of
False

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Copy link

openshift-ci bot commented Apr 22, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ykaliuta

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

@zdtsw
Copy link
Member Author

zdtsw commented Apr 22, 2024

the failure in the e2e is due to a missing tag on CFO 1.4.0
i will enable auto-merge this PR now.

@zdtsw zdtsw enabled auto-merge (squash) April 22, 2024 14:08
@zdtsw
Copy link
Member Author

zdtsw commented Apr 22, 2024

/test opendatahub-operator-e2e

@zdtsw zdtsw merged commit 3f94e61 into opendatahub-io:incubation Apr 22, 2024
7 of 8 checks passed
zdtsw added a commit to zdtsw-forking/rhods-operator that referenced this pull request May 9, 2024
…econcile (opendatahub-io#979)

* fix(status): do not flip back to Unknown when loop reconcile component

- init is only set for the very first time
- after that component not in the installed list then use Unknown
- otherwise, even it is not installed it has gone thro once so True of
False

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

* update: code review

Signed-off-by: Wen Zhou <wenzhou@redhat.com>

---------

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants