summaryrefslogtreecommitdiff
path: root/cmd/podman/pods
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/pods
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/pods')
-rw-r--r--cmd/podman/pods/create.go2
-rw-r--r--cmd/podman/pods/prune.go3
2 files changed, 2 insertions, 3 deletions
diff --git a/cmd/podman/pods/create.go b/cmd/podman/pods/create.go
index d33455e81..449d60bb9 100644
--- a/cmd/podman/pods/create.go
+++ b/cmd/podman/pods/create.go
@@ -218,7 +218,7 @@ func create(cmd *cobra.Command, args []string) error {
}
if len(podIDFile) > 0 {
if err = ioutil.WriteFile(podIDFile, []byte(response.Id), 0644); err != nil {
- return errors.Wrapf(err, "failed to write pod ID to file %q", podIDFile)
+ return errors.Wrapf(err, "failed to write pod ID to file")
}
}
fmt.Println(response.Id)
diff --git a/cmd/podman/pods/prune.go b/cmd/podman/pods/prune.go
index 626ef2895..444b0f5e0 100644
--- a/cmd/podman/pods/prune.go
+++ b/cmd/podman/pods/prune.go
@@ -12,7 +12,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"
)
@@ -51,7 +50,7 @@ func prune(cmd *cobra.Command, args []string) error {
fmt.Print("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