-
Couldn't load subscription status.
- Fork 580
rbd: cleanup and improve read-only volume handling #5290
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
Conversation
|
/test ci/centos/mini-e2e/k8s-1.31 |
| // Allow image to be mounted on multiple nodes if it is ROX | ||
| if req.GetVolumeCapability().GetAccessMode().GetMode() == csi.VolumeCapability_AccessMode_MULTI_NODE_READER_ONLY { | ||
| log.ExtendedLog(ctx, "setting disableInUseChecks on rbd volume to: %v", req.GetVolumeId) | ||
| volOptions.DisableInUseChecks = true |
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.
For other reviewers: it may look confusing that volOptions.DisableInUseChecks is removed here. It isn't needed, because the volOptions was created by populateRbdVol() which sets it already too.
|
/test ci/centos/mini-e2e/k8s-1.31 |
Failed with: |
|
/test ci/centos/mini-e2e-helm/k8s-1.31 |
|
/test ci/centos/mini-e2e/k8s-1.31 |
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.
Thanks
|
@Mergifyio queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at 31da098 |
The internal/csi-common package offers helper functions like `IsReaderOnly()` and `IsBlockMultiNode()`. These should be used instead of checking the VolumeCapability that is passed in a request in different places. This also suggested that adding the "ro" mount option in `NodeServer.mountVolumeToStagePath()` is not appropriate, as the csi-common helper `ConstructMountOptions()` can take care of that already too. Signed-off-by: Niels de Vos <[email protected]>
Volumes that were requested with a read-only capability should not be resized. Reported-by: Alex Kalenyuk <[email protected]> Signed-off-by: Niels de Vos <[email protected]>
1974feb to
a5a5032
Compare
|
/test ci/centos/k8s-e2e-external-storage/1.31 |
|
/test ci/centos/k8s-e2e-external-storage/1.30 |
|
/test ci/centos/mini-e2e-helm/k8s-1.31 |
|
/test ci/centos/k8s-e2e-external-storage/1.32 |
|
/test ci/centos/mini-e2e-helm/k8s-1.30 |
|
/test ci/centos/mini-e2e/k8s-1.31 |
|
/test ci/centos/mini-e2e-helm/k8s-1.32 |
|
/test ci/centos/mini-e2e/k8s-1.30 |
|
/test ci/centos/upgrade-tests-cephfs |
|
/test ci/centos/mini-e2e/k8s-1.32 |
|
/test ci/centos/upgrade-tests-rbd |
There are two components in this PR that are all related to the read-only handling while staging an RBD-image that is expected to be read-only:
use helper functions from csi-common for VolumeCapability checking
The internal/csi-common package offers helper functions like
IsReaderOnly()andIsBlockMultiNode(). These should be used insteadof checking the VolumeCapability that is passed in a request in
different places.
This also suggested that adding the "ro" mount option in
NodeServer.mountVolumeToStagePath()is not appropriate, as thecsi-common helper
ConstructMountOptions()can take care of thatalready too.
Volumes that were requested with a read-only capability should not be resized.
Show available bot commands
These commands are normally not required, but in case of issues, leave any of
the following bot commands in an otherwise empty comment in this PR:
/retest ci/centos/<job-name>: retest the<job-name>after unrelatedfailure (please report the failure too!)