Block Offboarding of Storage Consumer with OBCs [hold]#3696
Block Offboarding of Storage Consumer with OBCs [hold]#3696shirady wants to merge 1 commit intored-hat-storage:mainfrom
Conversation
|
Hi @shirady. Thanks for your PR. I'm waiting for a red-hat-storage member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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 think I found a bug not related to the suggested changes. |
|
@rewantsoni , @leelavg, please take a look |
@shirady This is the expected behaviour, the user creates the day 2 storage consumers, and they are responsible for deleting them. |
This would mean that the storage admin would need to use force deletion? |
Not force deletion but deletion of storageconsumer would work in this case |
I used the deletion, and it worked, thanks. |
826e688 to
e167d67
Compare
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rewantsoni, shirady The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
e167d67 to
aa32eba
Compare
Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
aa32eba to
d970971
Compare
|
@nb-ohad please take a look |
| obcList := &nbv1.ObjectBucketClaimList{} | ||
| if err := s.client.List( | ||
| ctx, | ||
| obcList, | ||
| &client.MatchingLabels{ | ||
| storageConsumerUUIDLabelKey: req.StorageConsumerUUID, | ||
| }, | ||
| client.Limit(1), | ||
| ); err != nil { | ||
| logger.Error(err, "failed to list OBCs for offboarding") | ||
| return nil, status.Errorf(codes.Internal, "failed to offboard storageConsumer with the provided UUID. %v", err) | ||
| } |
There was a problem hiding this comment.
I don't believe it make sense implemented here.
The storage admin has no course of action, or even understanding if the obcs are needed or not, as the owner of these obcs is the application owner.
It make more sense to have code on the client side that prevent the call to offboard in case the client does not match the right conditions. And as a matter of fact we already have an established pattern for that in the client operator:
There was a problem hiding this comment.
I thought that the source of truth related to the OBC is the provider so I created it as part of the check of offboarding (under the assumption that I'm blocking it).
Anyway, I like the suggestion to do it in ocs-client-operator to prevent the offboarding (fail fast).
I raised a PR red-hat-storage/ocs-client-operator#531
After reviewing PRs red-hat-storage/ocs-client-operator#520 and red-hat-storage/ocs-client-operator#531 we can discuss if it might be needed if not, I'll close this PR.
|
This PR should not get merged unless @shirady (or anyone else) can provide a good reply on: #3696 (comment) in the meantime putting this PR on hold |
|
The PR to prevent offboarding when there are OBCs related to the storage client was merged - red-hat-storage/ocs-client-operator#531. Closing this PR. |
Describe the problem
Part of RHSTOR-6230
Expanding the offboarding to return an error when an storage client has OBC.
Explain the changes
OffboardConsumerwhen a storage client has OBCs (by listing with the UUID consumer).Note: to avoid getting the consumer in a call and then checking its namespace, I used the list on all the namespaces in the provider-cluster.
services/provider/server/server_test.go.Testing Instructions:
Unit Tests
Please run:
go test -v -run TestOffboardConsumer ./services/provider/server/ -count=1Manual Test
Offboarding.From ocs-operator logs:
From ocs-client-operator logs: