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

Unset CephBlockPool mirroring if Mirroring spec is nil on SC #2937

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

Conversation

vbnrh
Copy link
Member

@vbnrh vbnrh commented Dec 19, 2024

Copy link
Contributor

openshift-ci bot commented Dec 19, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vbnrh
Once this PR has been reviewed and has the lgtm label, please assign blaineexe for approval. 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

@rewantsoni
Copy link
Member

/hold
This will cause problems with mirroring controller. As for provider mode, we will try to enable mirroring from the mirroring controller and the storageCluster controller will try to disable the mirroring.

@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 Dec 19, 2024
@rewantsoni
Copy link
Member

What we could do is,

if the storageCluster does not have provider mode annotation ( ocs.openshift.io/deployment-mode!= "provider")
  if storageCluster.Spec.Mirroring !=nil && storageCluster.Spec.Mirroring.Enabled
     enable mirroring and set the peer secrets
  else 
     disable mirroring

@umangachapagain @vbnrh WDYT?
This way, MCO could disable mirroring by setting the MirroringSpec as empty and the storageCluster controller would disable mirroring/use this field in non-provider mode.

And with converged when we move to use the mirroring controller to manage mirroring/secret exchange, we could remove enabling mirroring from the storageCluster controller (cephblockpool.go)

@vbnrh vbnrh force-pushed the DFBUGS-1185 branch 2 times, most recently from 1cdaff0 to e0e36f2 Compare December 19, 2024 09:14
Copy link
Member

@rewantsoni rewantsoni left a comment

Choose a reason for hiding this comment

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

There are other places in this file where we are enabling mirroring, please make sure that we follow the same in other places as well

Comment on lines 260 to 266
deploymentType, ok := storageCluster.Annotations["ocs.openshift.io/deployment-mode"]
if !ok {
return fmt.Errorf("deployment mode annotation not found")
}

// Since provider mode handles mirroring, we only need to handle for converged mode
if deploymentType != "provider" {
Copy link
Member

@rewantsoni rewantsoni Dec 19, 2024

Choose a reason for hiding this comment

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

We don't have the annotation for other modes

Suggested change
deploymentType, ok := storageCluster.Annotations["ocs.openshift.io/deployment-mode"]
if !ok {
return fmt.Errorf("deployment mode annotation not found")
}
// Since provider mode handles mirroring, we only need to handle for converged mode
if deploymentType != "provider" {
// Since provider mode handles mirroring, we only need to handle for internal mode
if storageCluster.Annotations["ocs.openshift.io/deployment-mode"] != "provider" {

Copy link
Member Author

Choose a reason for hiding this comment

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

Annotation is guaranteed to be there in all cases ?

Copy link
Member

Choose a reason for hiding this comment

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

No, it will be present only in provider mode, but if we query an empty map with a key that is not present it will return an empty value

Signed-off-by: vbadrina <vbadrina@redhat.com>
@rewantsoni
Copy link
Member

Were you able to verify it on a cluster?

@vbnrh
Copy link
Member Author

vbnrh commented Dec 19, 2024

Were you able to verify it on a cluster?

Not tested it but should work.

@rewantsoni
Copy link
Member

It would be good if you could verify it so we don't miss any edge cases. Maybe add the annotation to the internal Mode cluster and check that storageCluster doesn't reconcile the mirroring field. Anyway, I will un-hold the PR.
/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 Dec 19, 2024
@leelavg
Copy link
Contributor

leelavg commented Dec 19, 2024

@rewantsoni pls be aware that most if not all the traces of provider mode will be removed and this specific annotation will also go away starting in #2936 (4.19)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants