-
Notifications
You must be signed in to change notification settings - Fork 154
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
Simplify DataScienceCluster conditions #1501
base: main
Are you sure you want to change the base?
Simplify DataScienceCluster conditions #1501
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
b40b2d8
to
dfae715
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it is not easy to inject fault behaviors in existing components, I've refactored some DataScienceCluster
methods to pure functions so they can be tested in isolation.
/test opendatahub-operator-e2e |
/retest |
controllers/datasciencecluster/datasciencecluster_controller_support.go
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1501 +/- ##
==========================================
+ Coverage 19.89% 20.74% +0.85%
==========================================
Files 160 161 +1
Lines 10824 10846 +22
==========================================
+ Hits 2153 2250 +97
+ Misses 8444 8364 -80
- Partials 227 232 +5 ☔ View full report in Codecov by Sentry. |
852babe
to
ff4ee0c
Compare
This commit aims to simpplify the DataScienceCluster status conditions by removing transient conditions (Reconciling, Deploying, etc) and replacing them with two conditsion: - Available that is used to reflects the work done by the controller, so an Available condition with status False would signal that the controller encountered some troubles while reconciling the status of the cluster - Ready that is used to reflect the status of the component managed by the controller. It is perfectly possible to be in a state where Available=False and Ready=True which can happen in case the controller has troubles to perform some reconciliation logic because of i.e. a transient kubernetes error, but at the same time all the components are running. The object would then result in soimething like: apiVersion: datasciencecluster.opendatahub.io/v1 kind: DataScienceCluster metadata: name: default-dsc spec: {} status: conditions: - lastHeartbeatTime: "2025-01-15T12:54:20Z" lastTransitionTime: "2025-01-15T12:54:20Z" message: DataScienceCluster resource reconciled successfully reason: Available status: "True" type: Available - lastHeartbeatTime: "2025-01-15T12:54:20Z" lastTransitionTime: "2025-01-15T12:54:20Z" message: Ready reason: Ready status: "True" type: Ready It is possible to wait for the DataScienceCluster to be ready by using the kubectl wait command: kubectl wait --for=condition=ready datascienceclusters.datasciencecluster.opendatahub.io default-dsc
ff4ee0c
to
fd42704
Compare
Fine for me |
@lburgazzoli let me trigger tests against a build from your branch to check whether t breaks any test |
@asanzgom I think the disruptive tests can be affected due to this change. We'll see |
Description
This commit aims to simpplify the DataScienceCluster status conditions
by removing transient conditions (Reconciling, Deploying, etc) and
replacing them with two conditsion:
an Available condition with status False would signal that the
controller encountered some troubles while reconciling the status of
the cluster
the controller.
It is perfectly possible to be in a state where Available=False and
Ready=True which can happen in case the controller has troubles to
perform some reconciliation logic because of i.e. a transient kubernetes
error, but at the same time all the components are running.
The object would then result in soimething like:
It is possible to wait for the DataScienceCluster to be ready by using
the kubectl wait command:
kubectl wait --for=condition=ready datascienceclusters.datasciencecluster.opendatahub.io default-dsc
How Has This Been Tested?
Screenshot or short clip
Merge criteria