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