summaryrefslogtreecommitdiff
path: root/cmd/podman/images
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-04-29 16:21:43 +0200
committerValentin Rothberg <rothberg@redhat.com>2020-04-29 16:28:18 +0200
commit5ee3af2d03b595bdff004ec179fc8a38e97cc5fe (patch)
treeaa28abdc160c1e8c729ab4bd54e30c04e7badd41 /cmd/podman/images
parent2d10471b8da734c57867858e6e8340081ffd921c (diff)
downloadpodman-5ee3af2d03b595bdff004ec179fc8a38e97cc5fe.tar.gz
podman-5ee3af2d03b595bdff004ec179fc8a38e97cc5fe.tar.bz2
podman-5ee3af2d03b595bdff004ec179fc8a38e97cc5fe.zip
enable search tests
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'cmd/podman/images')
-rw-r--r--cmd/podman/images/search.go24
1 files changed, 16 insertions, 8 deletions
diff --git a/cmd/podman/images/search.go b/cmd/podman/images/search.go
index df4d83554..a8abfb339 100644
--- a/cmd/podman/images/search.go
+++ b/cmd/podman/images/search.go
@@ -1,6 +1,7 @@
package images
import (
+ "os"
"reflect"
"strings"
@@ -47,14 +48,15 @@ var (
// Command: podman image search
imageSearchCmd = &cobra.Command{
- Use: searchCmd.Use,
- Short: searchCmd.Short,
- Long: searchCmd.Long,
- RunE: searchCmd.RunE,
- Args: searchCmd.Args,
+ Use: searchCmd.Use,
+ Short: searchCmd.Short,
+ Long: searchCmd.Long,
+ RunE: searchCmd.RunE,
+ Args: searchCmd.Args,
+ Annotations: searchCmd.Annotations,
Example: `podman image search --filter=is-official --limit 3 alpine
- podman image search registry.fedoraproject.org/ # only works with v2 registries
- podman image search --format "table {{.Index}} {{.Name}}" registry.fedoraproject.org/fedora`,
+ podman image search registry.fedoraproject.org/ # only works with v2 registries
+ podman image search --format "table {{.Index}} {{.Name}}" registry.fedoraproject.org/fedora`,
}
)
@@ -108,7 +110,13 @@ func imageSearch(cmd *cobra.Command, args []string) error {
// which is important to implement a sane way of dealing with defaults of
// boolean CLI flags.
if cmd.Flags().Changed("tls-verify") {
- searchOptions.SkipTLSVerify = types.NewOptionalBool(!pullOptions.TLSVerifyCLI)
+ searchOptions.SkipTLSVerify = types.NewOptionalBool(!searchOptions.TLSVerifyCLI)
+ }
+
+ if searchOptions.Authfile != "" {
+ if _, err := os.Stat(searchOptions.Authfile); err != nil {
+ return errors.Wrapf(err, "error getting authfile %s", searchOptions.Authfile)
+ }
}
searchReport, err := registry.ImageEngine().Search(registry.GetContext(), searchTerm, searchOptions.ImageSearchOptions)