-
Notifications
You must be signed in to change notification settings - Fork 536
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
rbd: consider rbd as default mounter if not set. #3080
Conversation
@Madhu-1 |
@pkalever i tried to check the map options like |
These are Thanks! |
👍
Yes for nbd we can do that but let's wait for @idryomov reply to see if we can have a common approach to identity it.
|
internal/rbd/nodeserver.go
Outdated
@@ -252,7 +256,7 @@ func populateRbdVol( | |||
// fallback to rbd-nbd, | |||
rv.Mounter = rbdNbdMounter | |||
} else { | |||
rv.Mounter = req.GetVolumeContext()["mounter"] | |||
rv.Mounter = mounter |
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.
Shouldn't rv.Mounter
be already set here regardless because of
if rbdVol.Mounter, ok = volOptions["mounter"]; !ok {
rbdVol.Mounter = rbdDefaultMounter
}
in genVolFromVolumeOptions
?
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, correct, this is doing the same thing. removed it now.
@@ -241,7 +241,11 @@ func populateRbdVol( | |||
return nil, status.Error(codes.Internal, err.Error()) | |||
} | |||
|
|||
if req.GetVolumeContext()["mounter"] == rbdDefaultMounter && |
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 might be misreading, but I think you could just switch to querying rv.Mounter
instead of req.GetVolumeContext()["mounter"]
here and get rid of the else
branch entirely.
@idryomov changes are done PTAL. |
@Madhu-1 are you still considering adding e2e for MapOptions as part of this PR? |
As it needs to be added in multiple places, will send a follow-up PR. |
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 you want to delay the e2e test case addition PR, please consider raising an issue for now.
Rest all looks good to me!
@Mergifyio rebase |
For the default mounter the mounter option will not be set in the storageclass and as it is not available in the storageclass same will not be set in the volume context, Because of this the mapOptions are getting discarded. If the mounter is not set assuming it's an rbd mounter. Note:- If the mounter is not set in the storageclass we can set it in the volume context explicitly, Doing this check-in node server to support backward existing volumes and the check is minimal we are not altering the volume context. fixes: ceph#3076 Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
✅ Branch has been successfully rebased |
hmm.. ideally if mounter has not been set in the SC, discarding the |
This is a bug fix that got introduced recently. if the mounter is not set in the SC, default is chosen as the rbd if they are till now we are applying the mapOptions. i don't really understand the concern here. |
One thing which we have to be careful here is the scenario of |
what is the problem with that? why nbd will use krbd map options? mapOptions contains both krbd and nbd specific mapOptions. based on the mounter the specific mount options will be chosen. |
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.
The change looks good to me. The commit message is a little confusing, but I guess the small diff explains itself well enough too.
/retest ci/centos/mini-e2e-helm/k8s-1.21 |
@Mergifyio requeue |
❌ This pull request head commit has not been previously disembarked from queue. |
/retest ci/centos/mini-e2e-helm/k8s-1.21 |
@Mergifyio requeue |
❌ This pull request head commit has not been previously disembarked from queue. |
/retest ci/centos/mini-e2e-helm/k8s-1.21 |
@Mergifyio requeue |
❌ This pull request head commit has not been previously disembarked from queue. |
/retest ci/centos/mini-e2e-helm/k8s-1.21 |
@Mergifyio requeue |
❌ This pull request head commit has not been previously disembarked from queue. |
For the default mounter the mounter option will not be set in the storageclass and as it is not available in the storageclass same will not be set in the volume context, Because of this, the mapOptions are getting discarded. If the mounter is not set assuming it's an rbd mounter.
Note:- If the mounter is not set in the storageclass we can set it in the volume context explicitly, Doing this check-in node server to support backward existing volumes and the check is minimal we are not altering the volume context.
fixes: #3076
Signed-off-by: Madhu Rajanna madhupr007@gmail.com