DockerCLI/cli/config/configfile
Sebastiaan van Stijn 75ab44af6f
Fix ConfigFile.Save() replacing symlink with file
In situations where `~/.docker/config.json` was a symlink, saving
the file would replace the symlink with a file, instead of updating
the target file location;

    mkdir -p ~/.docker
    touch ~/real-config.json
    ln -s ~/real-config.json ~/.docker/config.json

    ls -la ~/.docker/config.json
    # lrwxrwxrwx 1 root root 22 Jun 23 12:34 /root/.docker/config.json -> /root/real-config.json

    docker login
    # Username: thajeztah
    # Password:

    # Login Succeeded

    ls -la ~/.docker/config.json
    -rw-r--r-- 1 root root 229 Jun 23 12:36 /root/.docker/config.json

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-07-16 11:35:41 +02:00
..
testdata Simplify cli plugin config file entry 2019-02-25 10:38:48 +00:00
file.go Fix ConfigFile.Save() replacing symlink with file 2020-07-16 11:35:41 +02:00
file_test.go Fix ConfigFile.Save() replacing symlink with file 2020-07-16 11:35:41 +02:00
file_unix.go config: preserve ownership and permissions on configfile 2019-12-17 09:57:33 +01:00
file_windows.go config: preserve ownership and permissions on configfile 2019-12-17 09:57:33 +01:00