Remove 'inspecting object' from inspect errors

This is just useless noise and gets us closer to what
Docker returns.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
Daniel J Walsh
2023-06-28 08:19:36 -04:00
parent be49741dc7
commit b6e636cbe2
2 changed files with 6 additions and 6 deletions

View File

@ -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
}

View File

@ -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