Merge pull request #19029 from rhatdan/inspect

Remove 'inspecting object' from inspect errors
This commit is contained in:
OpenShift Merge Robot
2023-06-28 17:00:10 +02:00
committed by GitHub
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