diff options
author | cdoern <cdoern@redhat.com> | 2022-01-13 16:41:13 -0500 |
---|---|---|
committer | cdoern <cdoern@redhat.com> | 2022-01-13 16:44:10 -0500 |
commit | bf3734ad53c6ad212c56730350e6265bf8278913 (patch) | |
tree | b386af5e3f2a4671be1349bebdc4ce1af1d5b365 /test/e2e | |
parent | 2c510146aa03c74fb00a15bcf81c62b14df9c7ea (diff) | |
download | podman-bf3734ad53c6ad212c56730350e6265bf8278913.tar.gz podman-bf3734ad53c6ad212c56730350e6265bf8278913.tar.bz2 podman-bf3734ad53c6ad212c56730350e6265bf8278913.zip |
Podman Build use absolute filepath
podman build always finds the abs path but was never using it for the containerfile path. This
was causing the remote client to be given a relative path that does not exist. Switch to evaluating and using absolute paths only.
resolves #12841
Signed-off-by: cdoern <cdoern@redhat.com>
Diffstat (limited to 'test/e2e')
-rw-r--r-- | test/e2e/build_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/e2e/build_test.go b/test/e2e/build_test.go index d4f0a2b04..c05dc6f3f 100644 --- a/test/e2e/build_test.go +++ b/test/e2e/build_test.go @@ -691,4 +691,19 @@ RUN ls /dev/test1`, ALPINE) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) }) + + It("podman build use absolute path even if given relative", func() { + containerFile := fmt.Sprintf(`FROM %s`, ALPINE) + err = os.Mkdir("relative", 0755) + Expect(err).To(BeNil()) + containerFilePath := filepath.Join("relative", "Containerfile") + fmt.Println(containerFilePath) + err = ioutil.WriteFile(containerFilePath, []byte(containerFile), 0755) + Expect(err).To(BeNil()) + build := podmanTest.Podman([]string{"build", "-f", "./relative/Containerfile"}) + build.WaitWithDefaultTimeout() + Expect(build).To(Exit(0)) + err = os.RemoveAll("relative") + Expect(err).To(BeNil()) + }) }) |