-
Notifications
You must be signed in to change notification settings - Fork 35
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
OCPBUGS-32709: Add conditions to LVMCluster status #628
OCPBUGS-32709: Add conditions to LVMCluster status #628
Conversation
@suleymanakbas91: This pull request references Jira Issue OCPBUGS-32709, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #628 +/- ##
==========================================
+ Coverage 77.61% 77.67% +0.06%
==========================================
Files 27 28 +1
Lines 1961 2016 +55
==========================================
+ Hits 1522 1566 +44
- Misses 320 338 +18
+ Partials 119 112 -7
|
@suleymanakbas91: This pull request references Jira Issue OCPBUGS-32709, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
@@ -0,0 +1,161 @@ | |||
package lvmcluster |
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.
This entire file seems pretty huge for 2 simple conditions, why not use a template variable for the condition and then just deep copy this whenever you need to initialize them?
b6562b3
to
3d171ff
Compare
/hold |
3d171ff
to
79e42fe
Compare
/retest |
1 similar comment
/retest |
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.
only a few codesmells but general approach is LGTM :)
if c.Status == metav1.ConditionTrue { | ||
readyConditionCount++ | ||
} else { | ||
state = translateReasonToState(c.Reason, state) |
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.
why do we only do this when a condition is false? shouldnt we recompute the state everytime?
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.
I changed it to always recompute. I also added an Unknown state as default to distinguish an unknown state from in progress. Tell me what you think.
Signed-off-by: Suleyman Akbas <sakbas@redhat.com>
79e42fe
to
b8fe49e
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.
/lgtm
Great Job on that PR, that one is big for maintaining conditions 🎉
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jakobmoellerdev, suleymanakbas91 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 |
@suleymanakbas91: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
/jira refresh |
@suleymanakbas91: This pull request references Jira Issue OCPBUGS-32709, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
/unhold |
@suleymanakbas91: Jira Issue OCPBUGS-32709: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-32709 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
This PR adds two new conditions to LVMCluster CR:
ResourcesAvailable
: Indicates whether the resources maintained by the operator are reconciled without any issues.VolumeGroupsReady
: Indicates whether the volume groups maintained by the operator are in a ready state.The state and the readiness of an LVMCluster CR is also now calculated using these conditions.