Skip to content

[Bug]: Missing-resource inspect behavior is inconsistent across resource types #1539

@realrajaryan

Description

@realrajaryan

I have done the following

  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project

Steps to reproduce

Inspect missing resources by explicit name:

$ container inspect definitely-missing-container-2157
[]

$ echo $?
0

$ container network inspect definitely-missing-network-2157
[]

$ echo $?
0

$ container image inspect definitely-missing-image:2157
image inspect failed: ["name": definitely-missing-image:2157, "error": Image not found]
Error: InspectError(succeeded: [], failed: [("definitely-missing-image:2157", notFound: "Image not found")])

$ echo $?
1

$ container volume inspect definitely-missing-volume-2157
Error: volume 'definitely-missing-volume-2157' not found

$ echo $?
1

Problem description

Inspecting a specifically named missing resource should behave consistently. Container and network inspect return [] with exit status 0, while image and volume inspect return nonzero missing-resource errors. Scripts cannot reliably distinguish a missing container/network from a successful empty result.

Environment

- OS: macOS 26.4.1 (25E253)
- Xcode: Xcode 26.4.1 (17E202)
- Container: container CLI 0.12.3 (build: release, commit: f989901)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions