diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2021-10-08 11:07:31 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2021-10-13 10:13:24 +0200 |
commit | 14bfee31f728c383f02be98a22e3528278d2feec (patch) | |
tree | 54deb3544ca7936c1ed959d5bbdc23025404bc00 /test | |
parent | 0b8673d0e7c335e7edbaf5e4d0393ed409f08efe (diff) | |
download | podman-14bfee31f728c383f02be98a22e3528278d2feec.tar.gz podman-14bfee31f728c383f02be98a22e3528278d2feec.tar.bz2 podman-14bfee31f728c383f02be98a22e3528278d2feec.zip |
podman search: display only name and description by default
Change the default format of `podman search` to only display the name
and the description of each image. The index is redundant to the name
and consumes a lot of space, and other descriptors (i.e., stars,
official, automated) are specific to Docker Hub and also consume a lot
space. Users can still use `--format` for displaying the descriptors
they want to.
Add a `--compatible` flag to offer an easy way to get them back.
Also update the man page to account for the behavior and get some fresh
data in the examples.
Motivated by a recent conversation in libimage:
https://github.com/containers/common/pull/802#issuecomment-937108734
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/e2e/search_test.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/e2e/search_test.go b/test/e2e/search_test.go index 243b1a307..10e991d9f 100644 --- a/test/e2e/search_test.go +++ b/test/e2e/search_test.go @@ -107,7 +107,18 @@ registries = ['{{.Host}}:{{.Port}}']` search.WaitWithDefaultTimeout() Expect(search).Should(Exit(0)) output := string(search.Out.Contents()) - match, _ := regexp.MatchString(`(?m)^quay.io\s+quay.io/libpod/whalesay\s+Static image used for automated testing.+$`, output) + match, _ := regexp.MatchString(`(?m)NAME\s+DESCRIPTION$`, output) + Expect(match).To(BeTrue()) + match, _ = regexp.MatchString(`(?m)quay.io/libpod/whalesay\s+Static image used for automated testing.+$`, output) + Expect(match).To(BeTrue()) + }) + + It("podman search image with --compatible", func() { + search := podmanTest.Podman([]string{"search", "--compatible", "quay.io/libpod/whalesay"}) + search.WaitWithDefaultTimeout() + Expect(search).Should(Exit(0)) + output := string(search.Out.Contents()) + match, _ := regexp.MatchString(`(?m)NAME\s+DESCRIPTION\s+STARS\s+OFFICIAL\s+AUTOMATED$`, output) Expect(match).To(BeTrue()) }) |