mirror of
https://github.com/containers/podman.git
synced 2025-12-10 07:42:12 +08:00
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>
19 lines
452 B
Go
19 lines
452 B
Go
package common
|
|
|
|
const (
|
|
// AllType can be of type ImageType or ContainerType.
|
|
AllType = "all"
|
|
// ArtifactType is the artifact type.
|
|
ArtifactType = "artifact"
|
|
// ContainerType is the container type.
|
|
ContainerType = "container"
|
|
// ImageType is the image type.
|
|
ImageType = "image"
|
|
// NetworkType is the network type
|
|
NetworkType = "network"
|
|
// PodType is the pod type.
|
|
PodType = "pod"
|
|
// VolumeType is the volume type
|
|
VolumeType = "volume"
|
|
)
|