Skip to content
This repository has been archived by the owner on Dec 26, 2017. It is now read-only.

Fix: trim nfs mount #294

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

till
Copy link

@till till commented Nov 2, 2015

On FreeBSD nfs mounts (path + host) are limited to 88 characters.
Which means that excluding the IP, there's 73 characters left to
build a path that works.

I can't do much about a long username, but e.g. I can try to trim
the path berkshelf creates to share the shelf into the VM.

I shortened "berkshelf" to "bs", and I dropped the suffix. Unless
I don't understand Dir.mktmpdir(), I think this should be "unique"
enough to work.

I'd add a test if someone gives me an idea what to test for. :)

On FreeBSD nfs mounts (path + host) are limited to 88 characters.
Which means that excluding the IP, there's 73 characters left to
build a path that works.

I can't do much about a long username, but e.g. I can try to trim
the path berkshelf creates to share the shelf into the VM.

I shortened "berkshelf" to "bs", and I dropped the suffix. Unless
I don't understand Dir.mktmpdir(), I think this should be "unique"
enough to work.

I'd add a test if someone gives me an idea what to test for. :)
@till
Copy link
Author

till commented Nov 2, 2015

Should probably note that this is a BC break for VMs that are running when the plugin is updated.

@till
Copy link
Author

till commented Nov 21, 2015

cc @sethvargo @reset — Any thoughts?

@reset
Copy link
Contributor

reset commented Nov 26, 2015

@till unfortunately this would break quite a bit more than you think. The shelves are uniquely named for the machine, which is why the machine name is included. If there are cases where the name must be shorter than X characters, which it seems is the case with some providers as you pointed out, we should instead perhaps choose a hashing function which will create a unique identifier within those character limits and use that value instead.

@till
Copy link
Author

till commented Nov 26, 2015

@reset do you think the machine name is really necessary? From what I understand mktmpdir() is already unique enough? Well, at least I think the point of that function is to create a unique temporary directory. The machine name makes it slightly more human-readable, but yeah... :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants