summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-12-13 14:54:03 -0500
committerGitHub <noreply@github.com>2021-12-13 14:54:03 -0500
commit4543fd463e3d02aea42f1a5b6ed0d2ed190de655 (patch)
tree5b9effef5151fa2974aba30a1aee06ec26872f98
parentb6ce7e19ec45c8bfd95356e03eb55090213887b4 (diff)
parent81a0a79844f952877f23dca680513dcd54d41c6d (diff)
downloadpodman-4543fd463e3d02aea42f1a5b6ed0d2ed190de655.tar.gz
podman-4543fd463e3d02aea42f1a5b6ed0d2ed190de655.tar.bz2
podman-4543fd463e3d02aea42f1a5b6ed0d2ed190de655.zip
Merge pull request #12571 from vrothberg/fix-12566
compat build: adhere to q/quiet
-rw-r--r--pkg/api/handlers/compat/images_build.go2
-rw-r--r--test/apiv2/10-images.at8
2 files changed, 7 insertions, 3 deletions
diff --git a/pkg/api/handlers/compat/images_build.go b/pkg/api/handlers/compat/images_build.go
index f85df02e1..a665be4fb 100644
--- a/pkg/api/handlers/compat/images_build.go
+++ b/pkg/api/handlers/compat/images_build.go
@@ -655,7 +655,7 @@ func BuildImage(w http.ResponseWriter, r *http.Request) {
return
case <-runCtx.Done():
if success {
- if !utils.IsLibpodRequest(r) {
+ if !utils.IsLibpodRequest(r) && !query.Quiet {
m.Stream = fmt.Sprintf("Successfully built %12.12s\n", imageID)
if err := enc.Encode(m); err != nil {
logrus.Warnf("Failed to json encode error %v", err)
diff --git a/test/apiv2/10-images.at b/test/apiv2/10-images.at
index e67f559f3..85d4d69ed 100644
--- a/test/apiv2/10-images.at
+++ b/test/apiv2/10-images.at
@@ -196,12 +196,16 @@ fi
curl -XPOST --data-binary @<(cat $CONTAINERFILE_TAR) \
-H "content-type: application/tar" \
--dump-header "${TMPD}/headers.txt" \
- -o /dev/null \
- "http://$HOST:$PORT/v1.40/libpod/build?dockerfile=containerfile" &> /dev/null
+ -o "${TMPD}/response.txt" \
+ "http://$HOST:$PORT/v1.40/build?dockerfile=containerfile&q=true" &> /dev/null
if ! grep -q '200 OK' "${TMPD}/headers.txt"; then
echo -e "${red}NOK: Image build from tar failed response was not 200 OK (application/tar)"
BUILD_TEST_ERROR="1"
fi
+if grep -E "\"[0-9a-f]{64}\\\n\"" $(jq .stream "${TMPD}/response.txt"); then
+ echo -e "${red} quiet-mode should only send image ID"
+ BUILD_TEST_ERROR="1"
+fi
# Yes, this is very un-RESTful re: Content-Type header ignored when compatibility endpoint used
# See https://github.com/containers/podman/issues/11012