summaryrefslogtreecommitdiff
path: root/cmd/podman/images
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-11-17 07:02:11 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2020-11-17 09:19:22 -0500
commit389dcb5c29d926e89d5d4c0b26ebf434c2fe5dcb (patch)
treef3970765fe109233dd441da8a7c5b3b5da3e945e /cmd/podman/images
parent7d067afac716927b26c452d4d75478b9f13abd62 (diff)
downloadpodman-389dcb5c29d926e89d5d4c0b26ebf434c2fe5dcb.tar.gz
podman-389dcb5c29d926e89d5d4c0b26ebf434c2fe5dcb.tar.bz2
podman-389dcb5c29d926e89d5d4c0b26ebf434c2fe5dcb.zip
Remove some more excessive wrapping and stuttering
Stop over wrapping API Calls The API calls will return an appropriate error, and this wrapping just makes the error message look like it is stuttering and a big mess. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/images')
-rw-r--r--cmd/podman/images/build.go6
-rw-r--r--cmd/podman/images/prune.go3
-rw-r--r--cmd/podman/images/sign.go2
-rw-r--r--cmd/podman/images/trust_set.go2
4 files changed, 6 insertions, 7 deletions
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go
index c76e4ac80..739e1c265 100644
--- a/cmd/podman/images/build.go
+++ b/cmd/podman/images/build.go
@@ -353,18 +353,18 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
isolation, err := parse.IsolationOption(flags.Isolation)
if err != nil {
- return nil, errors.Wrapf(err, "error parsing ID mapping options")
+ return nil, err
}
usernsOption, idmappingOptions, err := parse.IDMappingOptions(c, isolation)
if err != nil {
- return nil, errors.Wrapf(err, "error parsing ID mapping options")
+ return nil, err
}
nsValues = append(nsValues, usernsOption...)
systemContext, err := parse.SystemContextFromOptions(c)
if err != nil {
- return nil, errors.Wrapf(err, "error building system context")
+ return nil, err
}
format := ""
diff --git a/cmd/podman/images/prune.go b/cmd/podman/images/prune.go
index 3af56b015..e68fe5f40 100644
--- a/cmd/podman/images/prune.go
+++ b/cmd/podman/images/prune.go
@@ -11,7 +11,6 @@ import (
"github.com/containers/podman/v2/cmd/podman/utils"
"github.com/containers/podman/v2/cmd/podman/validate"
"github.com/containers/podman/v2/pkg/domain/entities"
- "github.com/pkg/errors"
"github.com/spf13/cobra"
)
@@ -60,7 +59,7 @@ WARNING! This will remove all dangling images.
Are you sure you want to continue? [y/N] `)
answer, err := reader.ReadString('\n')
if err != nil {
- return errors.Wrapf(err, "error reading input")
+ return err
}
if strings.ToLower(answer)[0] != 'y' {
return nil
diff --git a/cmd/podman/images/sign.go b/cmd/podman/images/sign.go
index 529fb3d92..342536f7c 100644
--- a/cmd/podman/images/sign.go
+++ b/cmd/podman/images/sign.go
@@ -58,7 +58,7 @@ func sign(cmd *cobra.Command, args []string) error {
if len(signOptions.Directory) > 0 {
sigStoreDir = signOptions.Directory
if _, err := os.Stat(sigStoreDir); err != nil {
- return errors.Wrapf(err, "invalid directory %s", sigStoreDir)
+ return err
}
}
_, err := registry.ImageEngine().Sign(registry.Context(), args, signOptions)
diff --git a/cmd/podman/images/trust_set.go b/cmd/podman/images/trust_set.go
index f0399b110..1a7392f3e 100644
--- a/cmd/podman/images/trust_set.go
+++ b/cmd/podman/images/trust_set.go
@@ -55,7 +55,7 @@ func setTrust(cmd *cobra.Command, args []string) error {
valid, err := image.IsValidImageURI(args[0])
if err != nil || !valid {
- return errors.Wrapf(err, "invalid image uri %s", args[0])
+ return err
}
if !util.StringInSlice(setOptions.Type, validTrustTypes) {