mirror of https://github.com/containers/podman.git
Don't log EOF error when using podman --remote build with an empty context directory.
Closes #15921. Signed-off-by: Romain Geissler <romain.geissler@amadeus.com>
This commit is contained in:
parent
b6a52f1f8b
commit
4ee31dc37f
|
|
@ -675,9 +675,10 @@ func nTar(excludes []string, sources ...string) (io.ReadCloser, error) {
|
||||||
}
|
}
|
||||||
defer p.Close()
|
defer p.Close()
|
||||||
_, err = p.Readdir(1)
|
_, err = p.Readdir(1)
|
||||||
if err != io.EOF {
|
if err == nil {
|
||||||
return nil // non empty root dir, need to return
|
return nil // non empty root dir, need to return
|
||||||
} else if err != nil {
|
}
|
||||||
|
if err != io.EOF {
|
||||||
logrus.Errorf("While reading directory %v: %v", path, err)
|
logrus.Errorf("While reading directory %v: %v", path, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1097,6 +1097,18 @@ EOF
|
||||||
run_podman rmi -f build_test
|
run_podman rmi -f build_test
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "podman build empty context dir" {
|
||||||
|
buildcontextdir=$PODMAN_TMPDIR/emptydir
|
||||||
|
mkdir -p $buildcontextdir
|
||||||
|
containerfile=$PODMAN_TMPDIR/Containerfile
|
||||||
|
echo FROM scratch >$containerfile
|
||||||
|
|
||||||
|
run_podman build -t build_test -f $containerfile $buildcontextdir
|
||||||
|
assert "$output" !~ "EOF" "output should not contain EOF error"
|
||||||
|
|
||||||
|
run_podman rmi -f build_test
|
||||||
|
}
|
||||||
|
|
||||||
function teardown() {
|
function teardown() {
|
||||||
# A timeout or other error in 'build' can leave behind stale images
|
# A timeout or other error in 'build' can leave behind stale images
|
||||||
# that podman can't even see and which will cascade into subsequent
|
# that podman can't even see and which will cascade into subsequent
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue