From 2c63b8439bbdc09203ea394ad2cf9352830861f0 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Sat, 10 Sep 2022 07:40:39 -0400 Subject: Fix stutters Podman adds an Error: to every error message. So starting an error message with "error" ends up being reported to the user as Error: error ... This patch removes the stutter. Also ioutil.ReadFile errors report the Path, so wrapping the err message with the path causes a stutter. Signed-off-by: Daniel J Walsh --- cmd/podman/images/build.go | 6 +++--- cmd/podman/images/list.go | 2 +- cmd/podman/images/utils_linux.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'cmd/podman/images') diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go index 837b233f4..2b24c1cff 100644 --- a/cmd/podman/images/build.go +++ b/cmd/podman/images/build.go @@ -222,7 +222,7 @@ func build(cmd *cobra.Command, args []string) error { // The context directory could be a URL. Try to handle that. tempDir, subDir, err := buildahDefine.TempDirForURL("", "buildah", args[0]) if err != nil { - return fmt.Errorf("error prepping temporary context directory: %w", err) + return fmt.Errorf("prepping temporary context directory: %w", err) } if tempDir != "" { // We had to download it to a temporary directory. @@ -237,7 +237,7 @@ func build(cmd *cobra.Command, args []string) error { // Nope, it was local. Use it as is. absDir, err := filepath.Abs(args[0]) if err != nil { - return fmt.Errorf("error determining path to directory %q: %w", args[0], err) + return fmt.Errorf("determining path to directory %q: %w", args[0], err) } contextDir = absDir } @@ -253,7 +253,7 @@ func build(cmd *cobra.Command, args []string) error { } absFile, err := filepath.Abs(containerFiles[i]) if err != nil { - return fmt.Errorf("error determining path to file %q: %w", containerFiles[i], err) + return fmt.Errorf("determining path to file %q: %w", containerFiles[i], err) } contextDir = filepath.Dir(absFile) containerFiles[i] = absFile diff --git a/cmd/podman/images/list.go b/cmd/podman/images/list.go index 94d8412e5..1c464d91c 100644 --- a/cmd/podman/images/list.go +++ b/cmd/podman/images/list.go @@ -225,7 +225,7 @@ func sortImages(imageS []*entities.ImageSummary) ([]imageReporter, error) { h.ImageSummary = *e h.Repository, h.Tag, err = tokenRepoTag(tag) if err != nil { - return nil, fmt.Errorf("error parsing repository tag: %q: %w", tag, err) + return nil, fmt.Errorf("parsing repository tag: %q: %w", tag, err) } if h.Tag == "" { untagged = append(untagged, h) diff --git a/cmd/podman/images/utils_linux.go b/cmd/podman/images/utils_linux.go index 5923716ec..935a45667 100644 --- a/cmd/podman/images/utils_linux.go +++ b/cmd/podman/images/utils_linux.go @@ -26,7 +26,7 @@ func setupPipe() (string, func() <-chan error, error) { if e := os.RemoveAll(pipeDir); e != nil { logrus.Errorf("Removing named pipe: %q", e) } - return "", nil, fmt.Errorf("error creating named pipe: %w", err) + return "", nil, fmt.Errorf("creating named pipe: %w", err) } go func() { fpipe, err := os.Open(pipePath) -- cgit v1.2.3-54-g00ecf