Files
podman/cmd/podman/inspect.go
Valentin Rothberg bd09b7aa79 bump go module to version 4
Automated for .go files via gomove [1]:
`gomove github.com/containers/podman/v3 github.com/containers/podman/v4`

Remaining files via vgrep [2]:
`vgrep github.com/containers/podman/v3`

[1] https://github.com/KSubedi/gomove
[2] https://github.com/vrothberg/vgrep

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2022-01-18 12:47:07 +01:00

47 lines
1.4 KiB
Go

package main
import (
"github.com/containers/podman/v4/cmd/podman/common"
"github.com/containers/podman/v4/cmd/podman/inspect"
"github.com/containers/podman/v4/cmd/podman/registry"
"github.com/containers/podman/v4/pkg/domain/entities"
"github.com/spf13/cobra"
)
var (
inspectDescription = `Displays the low-level information on an object identified by name or ID.
For more inspection options, see:
podman container inspect
podman image inspect
podman network inspect
podman pod inspect
podman volume inspect`
// Command: podman _inspect_ Object_ID
inspectCmd = &cobra.Command{
Use: "inspect [options] {CONTAINER|IMAGE|POD|NETWORK|VOLUME} [...]",
Short: "Display the configuration of object denoted by ID",
RunE: inspectExec,
Long: inspectDescription,
TraverseChildren: true,
ValidArgsFunction: common.AutocompleteInspect,
Example: `podman inspect fedora
podman inspect --type image fedora
podman inspect CtrID ImgID
podman inspect --format "imageId: {{.Id}} size: {{.Size}}" fedora`,
}
inspectOpts *entities.InspectOptions
)
func init() {
registry.Commands = append(registry.Commands, registry.CliCommand{
Command: inspectCmd,
})
inspectOpts = inspect.AddInspectFlagSet(inspectCmd)
}
func inspectExec(cmd *cobra.Command, args []string) error {
return inspect.Inspect(args, *inspectOpts)
}