mirror of
https://github.com/containers/podman.git
synced 2025-11-29 01:28:22 +08:00
fix artifact inspect issues
Fix remaining CI issues from PR #27182. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@@ -14,11 +14,11 @@ import (
|
||||
|
||||
var (
|
||||
inspectCmd = &cobra.Command{
|
||||
Use: "inspect [ARTIFACT...]",
|
||||
Use: "inspect [options] ARTIFACT",
|
||||
Short: "Inspect an OCI artifact",
|
||||
Long: "Provide details on an OCI artifact",
|
||||
RunE: artifactInspect,
|
||||
Args: cobra.MinimumNArgs(1),
|
||||
Args: cobra.ExactArgs(1),
|
||||
ValidArgsFunction: common.AutocompleteArtifacts,
|
||||
Example: `podman artifact inspect quay.io/myimage/myartifact:latest`,
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
podman\-artifact\-inspect - Inspect an OCI artifact
|
||||
|
||||
## SYNOPSIS
|
||||
**podman artifact inspect** [*name*] ...
|
||||
**podman artifact inspect** *name*
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
@@ -35,6 +35,10 @@ Valid placeholders for the Go template are listed below:
|
||||
| .Name | Artifact name (string) |
|
||||
| .TotalSizeBytes | Total Size of the artifact in bytes |
|
||||
|
||||
#### **--help**, **-h**
|
||||
|
||||
Print usage statement
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
Inspect an OCI image in the local store.
|
||||
|
||||
@@ -645,8 +645,10 @@ var _ = Describe("Podman artifact", func() {
|
||||
|
||||
artifactDigest := addArtifact1.OutputToString()
|
||||
|
||||
podmanTest.PodmanExitCleanly("artifact", "inspect", artifactDigest, "--format", "{{.Digest}}")
|
||||
podmanTest.PodmanExitCleanly("artifact", "inspect", artifactDigest[:12], "--format", "{{.Name}}")
|
||||
session := podmanTest.PodmanExitCleanly("artifact", "inspect", artifactDigest, "--format", "{{.Digest}}")
|
||||
Expect(session.OutputToString()).To(Equal("sha256:" + artifactDigest))
|
||||
session = podmanTest.PodmanExitCleanly("artifact", "inspect", artifactDigest[:12], "-f", "{{.Name}}")
|
||||
Expect(session.OutputToString()).To(Equal(artifact1Name))
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ function teardown() {
|
||||
run_podman '?' secret rm "s-$(safename)"
|
||||
run_podman '?' pod rm -f "p-$(safename)"
|
||||
run_podman '?' rm -f -t0 "c-$(safename)"
|
||||
run_podman '?' artifact rm "a-$(safename)"
|
||||
|
||||
basic_teardown
|
||||
}
|
||||
@@ -125,10 +126,12 @@ function check_subcommand() {
|
||||
ctrname="c-$(safename)"
|
||||
podname="p-$(safename)"
|
||||
secretname="s-$(safename)"
|
||||
artifactname="a-$(safename)"
|
||||
# Setup: some commands need a container, pod, secret, ...
|
||||
run_podman run -d --name $ctrname $IMAGE top
|
||||
run_podman pod create $podname
|
||||
run_podman secret create $secretname /etc/hosts
|
||||
run_podman artifact add $artifactname /etc/hosts
|
||||
|
||||
# For 'search' and 'image search': if local cache registry is available,
|
||||
# use it. This bypasses quay, and thus prevents flakes.
|
||||
@@ -147,7 +150,7 @@ image inspect | $IMAGE
|
||||
container inspect | $ctrname
|
||||
inspect | $ctrname
|
||||
|
||||
|
||||
artifact inspect | $artifactname
|
||||
volume inspect | -a
|
||||
secret inspect | $secretname
|
||||
network inspect | podman
|
||||
@@ -200,6 +203,7 @@ stats | --no-stream
|
||||
run_podman rm -f -t0 $ctrname
|
||||
run_podman secret rm $secretname
|
||||
run_podman '?' machine rm -f $machinename
|
||||
run_podman artifact rm $artifactname
|
||||
|
||||
# Make sure there are no leftover commands in our table - this would
|
||||
# indicate a typo in the table, or a flaw in our logic such that
|
||||
|
||||
Reference in New Issue
Block a user