mirror of https://github.com/containers/podman.git
podman inspect: fix error difference between local and remote
There is no reason for local and rmeote to use a different error that just differs in quoting. Make them consitent to simplify the tests. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
4364db989a
commit
8b1f06bf8f
|
@ -539,7 +539,7 @@ func (ic *ContainerEngine) ContainerInspect(ctx context.Context, namesOrIds []st
|
|||
// ErrNoSuchCtr is non-fatal, other errors will be
|
||||
// treated as fatal.
|
||||
if errors.Is(err, define.ErrNoSuchCtr) {
|
||||
errs = append(errs, fmt.Errorf("no such container %s", name))
|
||||
errs = append(errs, fmt.Errorf("no such container %q", name))
|
||||
continue
|
||||
}
|
||||
return nil, nil, err
|
||||
|
@ -550,7 +550,7 @@ func (ic *ContainerEngine) ContainerInspect(ctx context.Context, namesOrIds []st
|
|||
// ErrNoSuchCtr is non-fatal, other errors will be
|
||||
// treated as fatal.
|
||||
if errors.Is(err, define.ErrNoSuchCtr) {
|
||||
errs = append(errs, fmt.Errorf("no such container %s", name))
|
||||
errs = append(errs, fmt.Errorf("no such container %q", name))
|
||||
continue
|
||||
}
|
||||
return nil, nil, err
|
||||
|
|
|
@ -188,11 +188,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
|
||||
ctrInspect := podmanTest.Podman([]string{"container", "inspect", ALPINE})
|
||||
ctrInspect.WaitWithDefaultTimeout()
|
||||
if IsRemote() {
|
||||
Expect(ctrInspect).To(ExitWithError(125, fmt.Sprintf("no such container %q", ALPINE)))
|
||||
} else {
|
||||
Expect(ctrInspect).To(ExitWithError(125, fmt.Sprintf("no such container %s", ALPINE)))
|
||||
}
|
||||
Expect(ctrInspect).To(ExitWithError(125, fmt.Sprintf("no such container %q", ALPINE)))
|
||||
|
||||
imageInspect := podmanTest.Podman([]string{"image", "inspect", ALPINE})
|
||||
imageInspect.WaitWithDefaultTimeout()
|
||||
|
@ -399,11 +395,7 @@ var _ = Describe("Podman inspect", func() {
|
|||
|
||||
inspect := podmanTest.Podman([]string{"inspect", "--type", "container", podName})
|
||||
inspect.WaitWithDefaultTimeout()
|
||||
if IsRemote() {
|
||||
Expect(inspect).To(ExitWithError(125, fmt.Sprintf("no such container %q", podName)))
|
||||
} else {
|
||||
Expect(inspect).To(ExitWithError(125, fmt.Sprintf("no such container %s", podName)))
|
||||
}
|
||||
Expect(inspect).To(ExitWithError(125, fmt.Sprintf("no such container %q", podName)))
|
||||
})
|
||||
|
||||
It("podman inspect --type network on a container should fail", func() {
|
||||
|
|
|
@ -1081,7 +1081,7 @@ EOF
|
|||
is "$output" "$exit_code_prop" \
|
||||
"$basename: service container has the expected policy set in its annotations"
|
||||
else
|
||||
assert "$output" =~ "no such container $service_container" \
|
||||
assert "$output" =~ "no such container \"$service_container\"" \
|
||||
"$basename: unexpected error from podman container inspect"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue