-
Notifications
You must be signed in to change notification settings - Fork 185
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
add rpc call for RevokeBlockPoolPeering #2493
add rpc call for RevokeBlockPoolPeering #2493
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rewantsoni 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 |
5e98e4f
to
0ec534a
Compare
Testing:
Request:
After:
|
/test ocs-operator-bundle-e2e-aws |
err := c.client.Delete(ctx, cephRBDMirrorObj) | ||
if err == nil { | ||
return err | ||
} | ||
return nil |
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.
just club everything, return c.client.Delete(ctx, cephRBDMirrorObj)
if cephBlockPool.Spec.Mirroring.Peers != nil && len(cephBlockPool.Spec.Mirroring.Peers.SecretNames) > 0 { | ||
if len(cephBlockPool.Spec.Mirroring.Peers.SecretNames) > 0 { | ||
return true, nil | ||
} |
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.
there seems to be a redundant check here?
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.
yes, removed it
0ec534a
to
165b207
Compare
|
||
func (c *cephBlockPoolManager) DisableBlockPoolMirroring(ctx context.Context, blockPoolName string, cephBlockPool *rookCephv1.CephBlockPool) error { | ||
|
||
_, err := ctrl.CreateOrUpdate(ctx, c.client, cephBlockPool, func() error { |
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.
@rewantsoni could you pls bring this topic in today's team meeting for technical discussion, basically 1. should we use createorupdate on the resources that we didn't create, 2. should be use declarative style while servicing gRPC?
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.
As per discussion offline, updated to use Update rather than createOrUpdate for the resources we are not creating
165b207
to
0591fc5
Compare
0591fc5
to
6d38236
Compare
6d38236
to
8778fc3
Compare
8778fc3
to
1e5b762
Compare
1e5b762
to
65234ab
Compare
65234ab
to
8296f9d
Compare
services/provider/server/server.go
Outdated
err = s.cephBlockPoolManager.UnSetBootstrapSecretRef(ctx, req.SecretName, cephBlockPool) | ||
// there might be a case where the bootstrap secret was deleted but request failed after this and there was a retry, | ||
// if error is IsNotFound, that means it is safe to proceed as we have deleted the bootstrap secret | ||
if err != nil && !kerrors.IsNotFound(err) { |
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.
better handle the notfound on delete inside the func itself (same for the rest). Current func is doing two things, maybe state the same in the func name?
return nil, status.Errorf(codes.Internal, "Failed to get if rbd mirror is required: %v,", err) | ||
} | ||
|
||
if !isRBDMirrorRequired { |
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.
mirroring requires rbd-mirror and so you are deleting rbd-mirror if none of the cbp requires it, why not make the peering also consistent w/ this approach, like, client asks for peering but not explicitly enable mirroring as the latter is a hard requirement for the former?
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 am not sure I understand what you meant. For one-way mirroring to be set up, we need the following:
- Side A (primary) should enable mirroring on their blockpool to have the bootstrap secret generated which will be used by Side B (secondary)
- Side B enables the mirroring on their blockpool and set the bootstrap secret ref from side A
- Side B deploys the rbd mirror
Signed-off-by: Rewant Soni <[email protected]>
Signed-off-by: Rewant Soni <[email protected]>
Signed-off-by: Rewant Soni <[email protected]>
5845593
to
bb9d7f3
Compare
Signed-off-by: Rewant Soni <[email protected]>
Signed-off-by: Rewant Soni <[email protected]>
bb9d7f3
to
9a08e45
Compare
Signed-off-by: Rewant Soni <[email protected]>
9a08e45
to
45253cf
Compare
Closing this in favour of #2671 |
Add a new RPC call RevokeBlockPoolPeering to disable one-way mirroring between the block pools.
The rpc call is initiated from the primary cluster which wants to disable mirroring of the pool which was already mirrored, the server receives the request and does the following:
Depends On: