-
Notifications
You must be signed in to change notification settings - Fork 177
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
[WIP] Adds metadata to storage claim response proto message #2620
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: raaizik 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 |
/cc @nb-ohad |
/retest |
92d4cf5
to
60764a0
Compare
/cc @rewantsoni |
services/provider/server/server.go
Outdated
cbp := &rookCephv1.CephBlockPool{} | ||
err = s.client.Get(ctx, types.NamespacedName{Name: cephRes.Name, Namespace: s.namespace}, rns) | ||
if err != nil { | ||
return nil, status.Errorf(codes.Internal, "failed to get %s CephBlockPool. %v", cephRes.Name, 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.
Not sure what you are trying to achieve here, you are creating a cpb var but you are getting the radosnamespace.
Also, we should not depend on one cephBlockPool to decide if we are enabling mirroring or not. There might be a case where we might need to blacklist some blockpools for mirroring.
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.
No, I'm tagging the CBPRN class with a flag that will signal to StorageClaim's controller whether mirroring's enabled for said class.
There might be a case where we might need to blacklist some blockpools for mirroring.
Care to elaborate? What indicates a blacklisted pool? Either way, it's something that's better off handled on the client.
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.
err = s.client.Get(ctx, types.NamespacedName{Name: cephRes.Name, Namespace: s.namespace}, rns)
You are getting the rns here, not the cbl, is this intended?
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.
Discussed over DMs:
- CBP is the only source to fetch the mirroring flag from.
- In case of blacklisted pools we can have their flag indicating that override the mirroring flag.
services/provider/server/server.go
Outdated
cbp := &rookCephv1.CephBlockPool{} | ||
err = s.client.Get(ctx, types.NamespacedName{Name: cephRes.Name, Namespace: s.namespace}, rns) | ||
if err != nil { | ||
return nil, status.Errorf(codes.Internal, "failed to get %s CephBlockPool. %v", cephRes.Name, 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.
err = s.client.Get(ctx, types.NamespacedName{Name: cephRes.Name, Namespace: s.namespace}, rns)
You are getting the rns here, not the cbl, is this intended?
services/provider/server/server.go
Outdated
rbdStorageClassMetaData := map[string]string{ | ||
"mirroring": fmt.Sprintf("%v", cbp.Spec.Mirroring.Enabled), | ||
} |
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.
If I am not wrong this will always be false, as you are haven't fetched the cbp
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.
You are getting the rns here, not the cbl, is this intended?
CBPRN and its respective CPB carry the same name.
62ee5f8
to
97ff9bd
Compare
4652707
to
a052245
Compare
/retest |
af4ca4a
to
1e7beac
Compare
/retest-required |
Signed-off-by: raaizik <132667934+raaizik@users.noreply.github.com>
/retest |
I went through the PR and this works in the case of storageClaim of type block, if I am not wrong we also need to label the storageClass created by storageClaim of type filesystem as well right? How are we handling that? |
For |
@@ -153,6 +153,8 @@ message StorageClaimConfigRequest{ | |||
message StorageClaimConfigResponse{ | |||
// ExternalResource holds the configuration data of external storage cluster | |||
repeated ExternalResource externalResource = 1; | |||
// MetaData contains additional info regarding the external cluster resources | |||
bytes MetaData = 2; |
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.
no need to Title case the field as generated proto already gives us an exported field.
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.
Could be. I will take this into account.
@@ -153,6 +153,8 @@ message StorageClaimConfigRequest{ | |||
message StorageClaimConfigResponse{ | |||
// ExternalResource holds the configuration data of external storage cluster | |||
repeated ExternalResource externalResource = 1; | |||
// MetaData contains additional info regarding the external cluster resources | |||
bytes MetaData = 2; |
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.
after going through PR, why not bool enableMirroring = 2;
? why do we need to convert bool (cbp.Spec.Mirroring.Enabled
) into string (%v
) and then encode to bytes (json.Marshal
)
The default proto value will be false
anyways, unless false
is also a valid value like after enabling you could disable we don't need to use bool pointer.
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.
See first link in the description of the attached Jira for design details, @leelavg. We're looking at a feature that would allow us to add multiple fields that are considered as metadata. Once this PR's WIP tag is removed, there will be two flags appended to the metadata field.
Changes
Adds metadata field to storage claim response proto message that contains a mirroring flag of
CephBlockPool
to be read directly from theStorageClaim
's controller which will in turn label theStorageClass
with the required Ramen labels that allow RBD mirroring.RHSTOR-5754