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

Incorrect detection of overlapping mounts when 1 name is a substring #108

Closed
neil-greenwood opened this issue Jan 12, 2022 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@neil-greenwood
Copy link

colima version 0.2.2
git commit: b2c7697

$ colima start --mount $HOME/.aws/,$HOME/.aws_legacy/,$HOME/.ssh/,$HOME/git:w
INFO[0000] using docker runtime
INFO[0000] starting colima
FATA[0000] error starting vm: overlapping mounts not supported: '/Users/neil/.aws' overlaps '/Users/neil/.aws_legacy'

I would expect this to work, instead of the error message that is displayed.
I guess it might be a problem with lima, not colima itself.

@neil-greenwood
Copy link
Author

I tried the .aws_legacy directory with the name .aws-legacy first, and renamed it in case it was a word-separator issue. It still doesn't work when the directory is called .awslegacy.

@jandubois
Copy link

See lima-vm/lima#302

@neil-greenwood
Copy link
Author

But these don't overlap!

@neil-greenwood
Copy link
Author

This was my attempt to workaround lima-vm/lima#302

@jandubois
Copy link

Oops, sorry, looks like the check for overlapping mounts is in colima, and is just doing substring matches. So you should try renaming .aws_legacy to .legacy_aws and see if that works.

@neil-greenwood
Copy link
Author

That works. So it is the check that is at fault.

@abiosoft abiosoft added the bug Something isn't working label Jan 12, 2022
@jandubois
Copy link

Yes, it is a simple HasPrefix match:

if strings.HasPrefix(a, b) || strings.HasPrefix(b, a) {

@abiosoft I would "normalize" the names before comparison by making sure each mount ends with a /.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants