mirror of
https://github.com/containers/podman.git
synced 2025-05-17 15:18:43 +08:00
Add --no-trunc to artifact ls
added a --no-trunc flag to artifact ls, which follows what images has done. by default now, the ls output will have the shortened 12 character digest. the --no-trunc will output the full digest. Signed-off-by: Brent Baude <bbaude@redhat.com>
This commit is contained in:
@ -22,7 +22,7 @@ var _ = Describe("Podman artifact", func() {
|
||||
artifact1File, err := createArtifactFile(4192)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
artifact1Name := "localhost/test/artifact1"
|
||||
podmanTest.PodmanExitCleanly([]string{"artifact", "add", artifact1Name, artifact1File}...)
|
||||
add1 := podmanTest.PodmanExitCleanly([]string{"artifact", "add", artifact1Name, artifact1File}...)
|
||||
|
||||
artifact2File, err := createArtifactFile(10240)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
@ -43,6 +43,18 @@ var _ = Describe("Podman artifact", func() {
|
||||
// Make sure the names are what we expect
|
||||
Expect(output).To(ContainElement(artifact1Name))
|
||||
Expect(output).To(ContainElement(artifact2Name))
|
||||
|
||||
// Check default digest length (should be 12)
|
||||
defaultFormatSession := podmanTest.PodmanExitCleanly([]string{"artifact", "ls", "--format", "{{.Digest}}"}...)
|
||||
defaultOutput := defaultFormatSession.OutputToStringArray()[0]
|
||||
Expect(defaultOutput).To(HaveLen(12))
|
||||
|
||||
// Check with --no-trunc and verify the len of the digest is the same as the len what was returned when the artifact
|
||||
// was added
|
||||
noTruncSession := podmanTest.PodmanExitCleanly([]string{"artifact", "ls", "--no-trunc", "--format", "{{.Digest}}"}...)
|
||||
truncOutput := noTruncSession.OutputToStringArray()[0]
|
||||
Expect(truncOutput).To(HaveLen(len(add1.OutputToString())))
|
||||
|
||||
})
|
||||
|
||||
It("podman artifact simple add", func() {
|
||||
|
Reference in New Issue
Block a user