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

Mishandling of symlinks #1627

Closed
combatpoodle opened this issue Oct 28, 2014 · 5 comments
Closed

Mishandling of symlinks #1627

combatpoodle opened this issue Oct 28, 2014 · 5 comments

Comments

@combatpoodle
Copy link
Contributor

Working with the Docker communicator tonight I found that there's a false dichotomy in a few spots regarding file treatment since symlinks aren't considered. The Docker one should be fixed in the PR mentioned below.

It looks a similar issue was resolved in the SSH communicator in #449; but there's another copy in the file provisioner at provisioner/file/provisioner.go, lines 80-90:

    info, err := os.Stat(p.config.Source)
    if err != nil {
        return err
    }

    // If we're uploading a directory, short circuit and do that
    if info.IsDir() {
        return comm.UploadDir(p.config.Destination, p.config.Source, nil)
    }

    // We're uploading a file...
    f, err := os.Open(p.config.Source)
    if err != nil {
        return err
    }
    defer f.Close()

    fi, err := f.Stat()
    if err != nil {
        return err
    }

    err = comm.Upload(p.config.Destination, f, &fi)

I'm mixed on how to resolve that one without soiling interfaces and am a bit short on time ATM - would someone else have time to pick it up?

Thanks!

@bezidejni
Copy link

I'm not completely sure, but I may be running into the same problem when trying to build an image using a docker builder and ansible-local provisioner:

Build log
Folder in question

@benpatterson
Copy link

I'm running into this issue as well.

FWIW, I rebased #1628 on master and it now passes in Travis: https://travis-ci.org/benpatterson/packer/builds/40790013.

@bkeroackdsc
Copy link

I'm running into this with the Ansible provisioner and Docker builder. Our playbooks contain symlinks which do not appear to be followed when copying into the container.

EDIT: This would be a major advantage of Packer over Dockerfiles, since they refuse to follow symlinks (moby/moby#1676)

@arturhoo
Copy link
Contributor

arturhoo commented Apr 9, 2015

I am having the same problem when Ansible files are copied over to the machine: symlinks aren't followed.

EDIT: my issue was fixed by #1766

@mitchellh
Copy link
Contributor

I think the PRs fixed the specific issues. As we find more please open an issue.

@ghost ghost locked and limited conversation to collaborators Apr 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants