mirror of
https://github.com/containers/podman.git
synced 2025-10-13 01:06:10 +08:00
Add artifact fallback to podman inspect command
This commit implements automatic artifact fallback for the podman inspect command as requested in GitHub issue #27075. Changes made: - Add ArtifactType constant to cmd/podman/common/inspect.go - Update AutocompleteInspectType to include artifact type in completions - Add artifact case to main inspect switch statement for explicit --type artifact - Implement artifact fallback in inspectAll function for automatic detection - Update shell completion to recognize artifacts in getEntityType function - Update command help text, usage, and examples to include artifacts - Update podman-inspect.1.md man page with artifact documentation - Add comprehensive e2e tests for artifact inspect functionality The inspect command now automatically falls back to artifact inspection when no container, image, volume, network, or pod matches the specified name. Users can also explicitly use --type artifact for direct artifact inspection. This maintains backward compatibility while extending functionality to support the artifact object type seamlessly. Examples: podman inspect myartifact # Auto-detects artifact podman inspect --type artifact myartifact # Explicit artifact type podman inspect --format '{{.Name}}' myartifact # Format support Fixes: https://github.com/containers/podman/issues/27075 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -1,19 +1,20 @@
|
||||
% podman-inspect 1
|
||||
|
||||
## NAME
|
||||
podman\-inspect - Display a container, image, volume, network, or pod's configuration
|
||||
podman\-inspect - Display artifact, container, image, volume, network, or pod's configuration
|
||||
|
||||
## SYNOPSIS
|
||||
**podman inspect** [*options*] *name* [...]
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
This displays the low-level information on containers and images identified by name or ID. By default, this renders
|
||||
all results in a JSON array. If the inspect type is all, the order of inspection is: containers, images, volumes, network, pods.
|
||||
This displays the low-level information on artifacts, containers, and images identified by name or ID. By default, this renders
|
||||
all results in a JSON array. If the inspect type is all, the order of inspection is: containers, images, volumes, network, pods, artifacts.
|
||||
If a container has the same name as an image, then the container JSON is returned, and so on.
|
||||
If a format is specified, the given template is executed for each result.
|
||||
|
||||
For more inspection options, see also
|
||||
[podman-artifact-inspect(1)](podman-artifact-inspect.1.md),
|
||||
[podman-container-inspect(1)](podman-container-inspect.1.md),
|
||||
[podman-image-inspect(1)](podman-image-inspect.1.md),
|
||||
[podman-network-inspect(1)](podman-network-inspect.1.md),
|
||||
@ -35,7 +36,7 @@ In addition to normal output, display the total file size if the type is a conta
|
||||
|
||||
#### **--type**, **-t**=*type*
|
||||
|
||||
Return JSON for the specified type. Type can be 'container', 'image', 'volume', 'network', 'pod', or 'all' (default: all)
|
||||
Return JSON for the specified type. Type can be 'artifact', 'container', 'image', 'volume', 'network', 'pod', or 'all' (default: all)
|
||||
(Only meaningful when invoked as *podman inspect*)
|
||||
|
||||
## EXAMPLES
|
||||
@ -164,8 +165,22 @@ Inspect the specified network for the `Name` format specifier:
|
||||
myNetwork
|
||||
```
|
||||
|
||||
Inspect the specified artifact:
|
||||
```
|
||||
# podman inspect quay.io/myimage/myartifact:latest --type artifact
|
||||
{
|
||||
"Manifest": {
|
||||
"schemaVersion": 2,
|
||||
"mediaType": "application/vnd.oci.image.manifest.v1+json",
|
||||
...
|
||||
},
|
||||
"Name": "quay.io/myimage/myartifact:latest",
|
||||
"Digest": "sha256:..."
|
||||
}
|
||||
```
|
||||
|
||||
## SEE ALSO
|
||||
**[podman(1)](podman.1.md)**, **[podman-container-inspect(1)](podman-container-inspect.1.md)**, **[podman-image-inspect(1)](podman-image-inspect.1.md)**, **[podman-network-inspect(1)](podman-network-inspect.1.md)**, **[podman-pod-inspect(1)](podman-pod-inspect.1.md)**, **[podman-volume-inspect(1)](podman-volume-inspect.1.md)**
|
||||
**[podman(1)](podman.1.md)**, **[podman-artifact-inspect(1)](podman-artifact-inspect.1.md)**, **[podman-container-inspect(1)](podman-container-inspect.1.md)**, **[podman-image-inspect(1)](podman-image-inspect.1.md)**, **[podman-network-inspect(1)](podman-network-inspect.1.md)**, **[podman-pod-inspect(1)](podman-pod-inspect.1.md)**, **[podman-volume-inspect(1)](podman-volume-inspect.1.md)**
|
||||
|
||||
## HISTORY
|
||||
July 2017, Originally compiled by Dan Walsh <dwalsh@redhat.com>
|
||||
|
@ -367,7 +367,7 @@ the exit codes follow the `chroot` standard, see below:
|
||||
| [podman-import(1)](podman-import.1.md) | Import a tarball and save it as a filesystem image. |
|
||||
| [podman-info(1)](podman-info.1.md) | Display Podman related system information. |
|
||||
| [podman-init(1)](podman-init.1.md) | Initialize one or more containers |
|
||||
| [podman-inspect(1)](podman-inspect.1.md) | Display a container, image, volume, network, or pod's configuration. |
|
||||
| [podman-inspect(1)](podman-inspect.1.md) | Display artifact, container, image, volume, network, or pod's configuration. |
|
||||
| [podman-kill(1)](podman-kill.1.md) | Kill the main process in one or more containers. |
|
||||
| [podman-load(1)](podman-load.1.md) | Load image(s) from a tar archive into container storage. |
|
||||
| [podman-login(1)](podman-login.1.md) | Log in to a container registry. |
|
||||
|
Reference in New Issue
Block a user