diff options
author | Aditya R <arajan@redhat.com> | 2022-03-02 15:07:06 +0530 |
---|---|---|
committer | Aditya R <arajan@redhat.com> | 2022-03-02 19:02:33 +0530 |
commit | 0bd0ad59436436e93ac81ce46059d8618ed7766c (patch) | |
tree | ed3c97ca2cb90b11b557b4db9dcab97ee2e623c6 /test/e2e/build | |
parent | 7877b02aacf3e8d3d37f6283c6b8aa81688fd120 (diff) | |
download | podman-0bd0ad59436436e93ac81ce46059d8618ed7766c.tar.gz podman-0bd0ad59436436e93ac81ce46059d8618ed7766c.tar.bz2 podman-0bd0ad59436436e93ac81ce46059d8618ed7766c.zip |
container: workdir resolution must consider symlink if explicitly configured
While resolving `workdir` we mostly create a `workdir` when `stat`
fails with `ENOENT` or `ErrNotExist` however following cases are not
true when user explicitly specifies a `workdir` while `running` using
`--workdir` which tells `podman` to only use workdir if its exists on
the container. Following configuration is implicity set with other
`run` mechanism like `podman play kube`
Problem with explicit `--workdir` or similar implicit config in `podman play
kube` is that currently podman ignores the fact that workdir can also be
a `symlink` and actual `link` could be valid.
Hence following commit ensures that in such scenarios when a `workdir`
is not found and we cannot create a `workdir` podman must perform a
check to ensure that if `workdir` is a `symlink` and `link` is resolved
successfully and resolved link is present on the container then we
return as it is.
Docker performs a similar behviour.
Signed-off-by: Aditya R <arajan@redhat.com>
Diffstat (limited to 'test/e2e/build')
-rw-r--r-- | test/e2e/build/workdir-symlink/Dockerfile | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/e2e/build/workdir-symlink/Dockerfile b/test/e2e/build/workdir-symlink/Dockerfile new file mode 100644 index 000000000..abc9b47ee --- /dev/null +++ b/test/e2e/build/workdir-symlink/Dockerfile @@ -0,0 +1,5 @@ +FROM alpine +RUN mkdir /tmp/destination +RUN ln -s /tmp/destination /tmp/link +WORKDIR /tmp/link +CMD ["echo", "hello"] |