red-hat-storage / ocs-operator

Operator for RHOCS
Apache License 2.0
85 stars 184 forks source link

Set default CephDeviceClass in the status only if it's not set yet #2815

Closed malayparida2000 closed 2 months ago

malayparida2000 commented 2 months ago

The sc.Status.DefaultCephDeviceClass helps us to set the deviceClasses on the pool on the CRs. Till now we are trying to determine the field in each reconcile loop. But with the introduction of multiple deviceClasses support in day-2, we can't always determine it as the logic for the determination is that it chooses the first non replica-1 deviceClass from the list of deviceClasses on the cephCluster CR status. If we determine it in each reconcile loop, we are running the risk of going back & forth between the multiple non replica-1 deviceClasses.

Although the current ceph logic returns the list in a consistent order so the problem shouldn't appear today, but any change in this logic might introduce future bugs. as we have the assurance that any additional deviceClass will be added in day-2 only so we can safely set the default deviceClass in the status only if it's not set yet & not touch it there after.

Ref-https://issues.redhat.com/browse/RHSTOR-6444

malayparida2000 commented 2 months ago

/cc @travisn /cc @parth-gr

openshift-ci[bot] commented 2 months ago

@malayparida2000: GitHub didn't allow me to request PR reviews from the following users: parth-gr.

Note that only red-hat-storage members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to [this](https://github.com/red-hat-storage/ocs-operator/pull/2815#issuecomment-2367288170): >/cc @travisn >/cc @parth-gr Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
openshift-ci[bot] commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: malayparida2000, travisn

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](https://github.com/red-hat-storage/ocs-operator/blob/main/OWNERS)~~ [travisn] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment