diff --git a/cmd/podman/inspect/inspect.go b/cmd/podman/inspect/inspect.go index 22b2c90554..575080163d 100644 --- a/cmd/podman/inspect/inspect.go +++ b/cmd/podman/inspect/inspect.go @@ -185,16 +185,16 @@ func (i *inspector) inspect(namesOrIDs []string) error { err = rpt.Execute(data) } if err != nil { - errs = append(errs, fmt.Errorf("printing inspect output: %w", err)) + errs = append(errs, err) } if len(errs) > 0 { if len(errs) > 1 { for _, err := range errs[1:] { - fmt.Fprintf(os.Stderr, "error inspecting object: %v\n", err) + fmt.Fprintf(os.Stderr, "%v\n", err) } } - return fmt.Errorf("inspecting object: %w", errs[0]) + return errs[0] } return nil } diff --git a/test/system/700-play.bats b/test/system/700-play.bats index 3ae158270a..62bfe24787 100644 --- a/test/system/700-play.bats +++ b/test/system/700-play.bats @@ -266,7 +266,7 @@ EOF run_podman kube down $PODMAN_TMPDIR/test.yaml run_podman 125 inspect test_pod-test - is "$output" ".*Error: inspecting object: no such object: \"test_pod-test\"" + is "$output" ".*Error: no such object: \"test_pod-test\"" run_podman pod rm -a run_podman rm -a } @@ -454,7 +454,7 @@ _EOF run_podman kube down $PODMAN_TMPDIR/test.yaml run_podman 125 inspect test_pod-test - is "$output" ".*Error: inspecting object: no such object: \"test_pod-test\"" + is "$output" ".*Error: no such object: \"test_pod-test\"" run_podman pod rm -a run_podman rm -a } @@ -477,7 +477,7 @@ _EOF is "$output" "true" run_podman kube down $SERVER/testpod.yaml run_podman 125 inspect test_pod-test - is "$output" ".*Error: inspecting object: no such object: \"test_pod-test\"" + is "$output" ".*Error: no such object: \"test_pod-test\"" run_podman pod rm -a -f run_podman rm -a -f -t0