Skip to content
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

CSI: include volume namespace in staging path #20532

Merged
merged 2 commits into from May 13, 2024
Merged

Conversation

tgross
Copy link
Member

@tgross tgross commented May 3, 2024

CSI volumes are namespaced. But the client does not include the namespace in the staging mount path. This causes CSI volumes with the same volume ID but different namespace to collide if they happen to be placed on the same host. The per-allocation paths don't need to be namespaced, because an allocation can only mount volumes from its job's own namespace.

Fixes: #18741
See #18741 (comment) for my notes on upgrade testing.

tgross added 2 commits May 9, 2024 10:19
CSI volumes are are namespaced. But the client does not include the namespace in
the staging mount path. This causes CSI volumes with the same volume ID but
different namespace to collide if they happen to be placed on the same host.

Fixes: #18741
Rework the CSI hook tests to have more fine-grained control over the mock
on-disk state. Add tests covering upgrades from staging paths missing
namespaces.
@tgross tgross marked this pull request as ready for review May 9, 2024 14:33
@tgross tgross added this to the 1.8.0 milestone May 9, 2024
@tgross tgross added backport/1.6.x backport to 1.6.x release line backport/1.7.x backport to 1.7.x release line labels May 9, 2024
@tgross tgross requested a review from shoenig May 10, 2024 20:16
@@ -33,6 +33,12 @@ func (c *CallCounter) Get() map[string]int {
return maps.Clone(c.counts)
}

func (c *CallCounter) Reset() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im failing to see where do we use this one

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here so that we can use the MountVolume code path to setup an expected environment and then reset the calls so that the test assertion only lists the unmount/unpublish calls we expect.

Copy link
Member

@Juanadelacuesta Juanadelacuesta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty straight forward, nice job

@tgross tgross merged commit 65ae612 into main May 13, 2024
23 checks passed
@tgross tgross deleted the csi-staging-conflicts branch May 13, 2024 15:24
tgross added a commit that referenced this pull request May 13, 2024
CSI volumes are namespaced. But the client does not include the namespace in the
staging mount path. This causes CSI volumes with the same volume ID but
different namespace to collide if they happen to be placed on the same host. The
per-allocation paths don't need to be namespaced, because an allocation can only
mount volumes from its job's own namespace.

Rework the CSI hook tests to have more fine-grained control over the mock
on-disk state. Add tests covering upgrades from staging paths missing
namespaces.

Fixes: #18741
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.6.x backport to 1.6.x release line backport/1.7.x backport to 1.7.x release line hcc/cst Admin - internal theme/storage type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSI volumes staging mount path collision between namespaces with CSI plugins that support staging
2 participants