Skip to content

Commit 339a432

Browse files
committed
fix artifact inspect issues
Fix remaining CI issues from PR #27182. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
1 parent 1fbf24b commit 339a432

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

cmd/podman/artifact/inspect.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import (
1414

1515
var (
1616
inspectCmd = &cobra.Command{
17-
Use: "inspect [ARTIFACT...]",
17+
Use: "inspect [options] ARTIFACT",
1818
Short: "Inspect an OCI artifact",
1919
Long: "Provide details on an OCI artifact",
2020
RunE: artifactInspect,
21-
Args: cobra.MinimumNArgs(1),
21+
Args: cobra.ExactArgs(1),
2222
ValidArgsFunction: common.AutocompleteArtifacts,
2323
Example: `podman artifact inspect quay.io/myimage/myartifact:latest`,
2424
}

docs/source/markdown/podman-artifact-inspect.1.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
podman\-artifact\-inspect - Inspect an OCI artifact
55

66
## SYNOPSIS
7-
**podman artifact inspect** [*name*] ...
7+
**podman artifact inspect** *name*
88

99
## DESCRIPTION
1010

@@ -35,6 +35,10 @@ Valid placeholders for the Go template are listed below:
3535
| .Name | Artifact name (string) |
3636
| .TotalSizeBytes | Total Size of the artifact in bytes |
3737

38+
#### **--help**, **-h**
39+
40+
Print usage statement
41+
3842
## EXAMPLES
3943

4044
Inspect an OCI image in the local store.

test/e2e/artifact_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,8 +645,10 @@ var _ = Describe("Podman artifact", func() {
645645

646646
artifactDigest := addArtifact1.OutputToString()
647647

648-
podmanTest.PodmanExitCleanly("artifact", "inspect", artifactDigest, "--format", "{{.Digest}}")
649-
podmanTest.PodmanExitCleanly("artifact", "inspect", artifactDigest[:12], "--format", "{{.Name}}")
648+
session := podmanTest.PodmanExitCleanly("artifact", "inspect", artifactDigest, "--format", "{{.Digest}}")
649+
Expect(session.OutputToString()).To(Equal("sha256:" + artifactDigest))
650+
session = podmanTest.PodmanExitCleanly("artifact", "inspect", artifactDigest[:12], "-f", "{{.Name}}")
651+
Expect(session.OutputToString()).To(Equal(artifact1Name))
650652
})
651653
})
652654

test/system/610-format.bats

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ function teardown() {
1212
run_podman '?' secret rm "s-$(safename)"
1313
run_podman '?' pod rm -f "p-$(safename)"
1414
run_podman '?' rm -f -t0 "c-$(safename)"
15+
run_podman '?' artifact rm "a-$(safename)"
1516

1617
basic_teardown
1718
}
@@ -125,10 +126,12 @@ function check_subcommand() {
125126
ctrname="c-$(safename)"
126127
podname="p-$(safename)"
127128
secretname="s-$(safename)"
129+
artifactname="a-$(safename)"
128130
# Setup: some commands need a container, pod, secret, ...
129131
run_podman run -d --name $ctrname $IMAGE top
130132
run_podman pod create $podname
131133
run_podman secret create $secretname /etc/hosts
134+
run_podman artifact add $artifactname /etc/hosts
132135

133136
# For 'search' and 'image search': if local cache registry is available,
134137
# use it. This bypasses quay, and thus prevents flakes.
@@ -147,7 +150,7 @@ image inspect | $IMAGE
147150
container inspect | $ctrname
148151
inspect | $ctrname
149152
150-
153+
artifact inspect | $artifactname
151154
volume inspect | -a
152155
secret inspect | $secretname
153156
network inspect | podman
@@ -200,6 +203,7 @@ stats | --no-stream
200203
run_podman rm -f -t0 $ctrname
201204
run_podman secret rm $secretname
202205
run_podman '?' machine rm -f $machinename
206+
run_podman artifact rm $artifactname
203207

204208
# Make sure there are no leftover commands in our table - this would
205209
# indicate a typo in the table, or a flaw in our logic such that

0 commit comments

Comments
 (0)