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

OCPBUGS-32709: Add conditions to LVMCluster status #628

Merged
merged 1 commit into from
May 29, 2024

Conversation

suleymanakbas91
Copy link
Contributor

@suleymanakbas91 suleymanakbas91 commented May 16, 2024

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.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels May 16, 2024
@openshift-ci-robot
Copy link

@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
  • bug is open, matching expected state (open)
  • bug target version (4.16.0) matches configured target version for branch (4.16.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @radeore

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.

@openshift-ci openshift-ci bot requested a review from radeore May 16, 2024 08:50
@openshift-ci openshift-ci bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label May 16, 2024
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 16, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 16, 2024

Codecov Report

Attention: Patch coverage is 71.75573% with 37 lines in your changes are missing coverage. Please review.

Project coverage is 77.67%. Comparing base (0816722) to head (b8fe49e).

Additional details and impacted files

Impacted file tree graph

@@            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     
Files Coverage Δ
api/v1alpha1/lvmcluster_types.go 100.00% <ø> (ø)
internal/controllers/lvmcluster/controller.go 61.80% <53.33%> (-2.10%) ⬇️
internal/controllers/lvmcluster/status.go 74.13% <74.13%> (ø)

@openshift-ci-robot
Copy link

@suleymanakbas91: This pull request references Jira Issue OCPBUGS-32709, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.16.0) matches configured target version for branch (4.16.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @radeore

In response to this:

This PR adds two new conditions to LVMCluster CR:

  • ResourcesSynced: 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.

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.

internal/controllers/lvmcluster/controller.go Outdated Show resolved Hide resolved
@@ -0,0 +1,161 @@
package lvmcluster
Copy link
Contributor

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?

internal/controllers/lvmcluster/status.go Outdated Show resolved Hide resolved
internal/controllers/lvmcluster/status.go Outdated Show resolved Hide resolved
internal/controllers/lvmcluster/status.go Outdated Show resolved Hide resolved
internal/controllers/lvmcluster/status.go Outdated Show resolved Hide resolved
internal/controllers/lvmcluster/status.go Show resolved Hide resolved
api/v1alpha1/lvmcluster_types.go Outdated Show resolved Hide resolved
internal/controllers/lvmcluster/controller.go Outdated Show resolved Hide resolved
@suleymanakbas91
Copy link
Contributor Author

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 17, 2024
@suleymanakbas91
Copy link
Contributor Author

/retest

1 similar comment
@suleymanakbas91
Copy link
Contributor Author

/retest

Copy link
Contributor

@jakobmoellerdev jakobmoellerdev left a 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 :)

internal/controllers/lvmcluster/status.go Show resolved Hide resolved
if c.Status == metav1.ConditionTrue {
readyConditionCount++
} else {
state = translateReasonToState(c.Reason, state)
Copy link
Contributor

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?

Copy link
Contributor Author

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.

internal/controllers/lvmcluster/status.go Show resolved Hide resolved
internal/controllers/lvmcluster/controller.go Outdated Show resolved Hide resolved
internal/controllers/lvmcluster/controller.go Outdated Show resolved Hide resolved
Signed-off-by: Suleyman Akbas <sakbas@redhat.com>
Copy link
Contributor

@jakobmoellerdev jakobmoellerdev left a 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 🎉

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label May 29, 2024
Copy link
Contributor

openshift-ci bot commented May 29, 2024

[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:
  • OWNERS [jakobmoellerdev,suleymanakbas91]

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

Copy link
Contributor

openshift-ci bot commented May 29, 2024

@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.

@suleymanakbas91
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot
Copy link

@suleymanakbas91: This pull request references Jira Issue OCPBUGS-32709, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.17.0) matches configured target version for branch (4.17.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @radeore

In response to this:

/jira refresh

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.

@suleymanakbas91
Copy link
Contributor Author

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 29, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit ef667bd into openshift:main May 29, 2024
9 checks passed
@openshift-ci-robot
Copy link

@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:

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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants