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

WIP: Refactor reconcilor so each component is returning status #765

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

anishasthana
Copy link
Member

@anishasthana anishasthana commented Dec 30, 2024

Related issue: https://issues.redhat.com/browse/RHOAIENG-13321

I took a stab at doing what I think the underlying issue is asking for. @hbelmiro let me know if I'm on the right track!

I haven't gone through and updated all the dependent functions yet since I don't want to go down the stack if my starting point is completely wrong.

Related: #683 (comment)

Copy link
Contributor

openshift-ci bot commented Dec 30, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from anishasthana. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-765

@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-765

@dsp-developers
Copy link
Contributor

Change to PR detected. A new PR build was completed.
A new image has been built to help with testing out this PR: quay.io/opendatahub/data-science-pipelines-operator:pr-765

dspa *dspav1.DataSciencePipelinesApplication, setStatus func(metav1.Condition),
log logr.Logger) {
condition, err := r.evaluateCondition(ctx, dspa, resourceName, conditionType)
condition.Message = statusMessage
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if overwriting the Message here is the right call. The reason I'm wondering that is that https://github.com/opendatahub-io/data-science-pipelines-operator/blob/main/controllers/dspipeline_controller.go#L406 has a number of instances in which it is setting the Message field itself. Thoughts @hbelmiro ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I actually proposed replacing

r.setStatus(ctx, params.MlmdProxyDefaultResourceName, config.MLMDProxyReady, statusMessage, dspa,
				dspaStatus.SetMLMDProxyStatus, log)

with

			condition, err := r.evaluateCondition(ctx, dspa, params.MlmdProxyDefaultResourceName, config.MLMDProxyReady)
			condition.Message = status
			if err != nil {
				r.setStatusAsNotReady(config.MLMDProxyReady, err, dspaStatus.SetMLMDProxyStatus)
				return ctrl.Result{}, err
			}
			dspaStatus.SetMLMDProxyStatus(condition)

here.

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.

3 participants