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

enhancement: unique mount point path #4714

Merged
merged 4 commits into from
Jun 10, 2024

Conversation

fschade
Copy link
Contributor

@fschade fschade commented Jun 6, 2024

This PR introduces a new feature that ensures all mounted shares have a unique path. This is achieved by checking for potential name collisions against existing mount points and adjusting the mount point name if necessary.

Overview:

  • Check if the requested mount point is available and if not, finds a suitable one.
  • If no mount point is provided, it finds a it generated a suitable mount point based on the name
  • If the mount point already exists, a number is inserted into the filename to make it unique.

This enhances the robustness of the share mounting process and prevents potential issues caused by duplicate mounts.

before

Screenshot 2024-06-10 at 12 57 53

after

Screenshot 2024-06-10 at 12 59 41

Copy link

update-docs bot commented Jun 6, 2024

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

Copy link
Contributor

@kobergj kobergj left a comment

Choose a reason for hiding this comment

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

Some nitpicking. Rest looks good 👍

@fschade fschade force-pushed the unique-share-mount-name branch from 34fb97a to 15bb511 Compare June 10, 2024 11:57
@fschade
Copy link
Contributor Author

fschade commented Jun 10, 2024

@rhafer is right with the strange tar handling, i removed it, lets see what the ci is saying, but i want to revisit this in a sec... i have a idea

@fschade
Copy link
Contributor Author

fschade commented Jun 10, 2024

@rhafer is right with the strange tar handling, i removed it, lets see what the ci is saying, but i want to revisit this in a sec... i have a idea

Ok, let’s move on and remove it if you’re fine with it too,
foo.tar.gz, basename is foo.tar and extension is gz, I think that’s valid!

@fschade fschade self-assigned this Jun 10, 2024
@fschade fschade marked this pull request as ready for review June 10, 2024 12:23
@fschade fschade requested review from labkode, a team and glpatcern as code owners June 10, 2024 12:23
@fschade fschade requested review from kobergj and rhafer June 10, 2024 12:49
var requestedMountpoint string
switch {
case slices.Contains(req.GetUpdateMask().GetPaths(), _fieldMaskPathMountPoint) && req.GetShare().GetMountPoint().GetPath() != "":
requestedMountpoint = req.GetShare().GetMountPoint().GetPath()
Copy link
Contributor

@rhafer rhafer Jun 10, 2024

Choose a reason for hiding this comment

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

I am still not completely sure about the semantics when the incoming request actually contains a MountPoint. I think in that case we should not do the game with the suffix number.

I'd prefer to be explicit in that case and make the request fail with an appropriate Status if the mountpoint is already taken.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I’m with you, but that means clients have to implement that a user can change the mount point name (I would prefer that too).

but that needs some time, maybe we should merge it that way, talk to the clients and then change it to error in the case of explicit conflicts

Copy link
Contributor

Choose a reason for hiding this comment

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

I’m with you, but that means clients have to implement that a user can change the mount point name (I would prefer that too).

Hm, I am not sure I get that. Clients (as in CS3 clients) are already able to change the mount point name, aren't they?

The fact that our currently used clients at the higher-level (every thing that comes in via libregraph e.g.) don't make use of that does not change that. But in that case they shouldn't send a mountpoint at all.

Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively I'd be find if we'd just not allow UpdateReceivedShare Request with a _fieldMaskPathMountPoint at all for now.

Copy link
Contributor

@kobergj kobergj left a comment

Choose a reason for hiding this comment

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

Looks good to me for now 👍

@fschade fschade force-pushed the unique-share-mount-name branch from 15bb511 to dc36341 Compare June 10, 2024 15:05
@fschade fschade force-pushed the unique-share-mount-name branch from dc36341 to 4c01ace Compare June 10, 2024 15:56
@fschade fschade merged commit c9da900 into cs3org:edge Jun 10, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants