bhurlow/machine-share

Import breaks empty string and URL config settings.

alrik opened this issue · 4 comments

alrik commented

On import all empty string config values become "." due to path.join('') === '.'

So a config of

{
    "ConfigVersion": 3,
    "Driver": {
        "CaCert": "",
        "DomainID": "",
        "DomainName": ""
    }
}

will become

{
    "ConfigVersion": 3,
    "Driver": {
        "CaCert": ".",
        "DomainID": ".",
        "DomainName": "."
    }
}

That will break any further docker-machine operations:

$ docker-machine ls
Error attempting call to get driver name: connection is shut down
NAME           ACTIVE   DRIVER   STATE   URL   SWARM   DOCKER    ERRORS
myMachine      -                 Error                 Unknown   read .: is a directory

I'll submit a PR asp.

alrik commented

@bhurlow I think empty strings are not the only problem, but also urls:
path.join('https://openstack-host.xy/2.0') => 'https:/openstack-host.xy/2.0'

What do you think about only path-joining config settings, that contain {{HOME}} in import.js?
Could that possibly break windows compatibility?

@alrik Hi! Ok thanks

Is this issue still reproducible?

I thought I fixed most, or even all the windows/unix pathing problems with #18

alrik commented

I think this issue can be closed :)