mirror of
https://github.com/containers/podman.git
synced 2025-12-01 10:38:05 +08:00
Merge pull request #27182 from skyraider256526/main
feat: add `--format` flag to artifact inspect
This commit is contained in:
@@ -668,6 +668,20 @@ var _ = Describe("Podman artifact", func() {
|
||||
// Verify we have 2 layers
|
||||
Expect(a.Manifest.Layers).To(HaveLen(2))
|
||||
})
|
||||
|
||||
It("podman artifact inspect with --format", func() {
|
||||
artifact1File, err := createArtifactFile(4192)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
artifact1Name := "localhost/test/artifact1"
|
||||
addArtifact1 := podmanTest.PodmanExitCleanly("artifact", "add", artifact1Name, artifact1File)
|
||||
|
||||
artifactDigest := addArtifact1.OutputToString()
|
||||
|
||||
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))
|
||||
})
|
||||
})
|
||||
|
||||
func digestToFilename(digest string) string {
|
||||
|
||||
Reference in New Issue
Block a user