@@ -14,6 +14,7 @@ import (
14
14
"github.com/containers/podman/v5/utils"
15
15
. "github.com/onsi/ginkgo/v2"
16
16
. "github.com/onsi/gomega"
17
+ imgspec "github.com/opencontainers/image-spec/specs-go/v1"
17
18
)
18
19
19
20
const (
@@ -99,6 +100,7 @@ var _ = Describe("Podman artifact", func() {
99
100
It ("podman artifact add with options" , func () {
100
101
yamlType := "text/yaml"
101
102
artifact1Name := "localhost/test/artifact1"
103
+ artifact2Name := "localhost/test/artifact2"
102
104
artifact1File , err := createArtifactFile (1024 )
103
105
Expect (err ).ToNot (HaveOccurred ())
104
106
@@ -115,9 +117,11 @@ var _ = Describe("Podman artifact", func() {
115
117
Expect (a .Manifest .Layers [0 ].Annotations ["flavor" ]).To (Equal ("lemon" ))
116
118
Expect (a .Manifest .Layers [0 ].MediaType ).To (Equal (yamlType ))
117
119
118
- failSession := podmanTest .Podman ([]string {"artifact" , "add" , "--annotation" , "org.opencontainers.image.title=foobar" , "foobar" , artifact1File })
119
- failSession .WaitWithDefaultTimeout ()
120
- Expect (failSession ).Should (ExitWithError (125 , "Error: cannot override filename with org.opencontainers.image.title annotation" ))
120
+ title := RandomString (12 )
121
+ annotation3 := fmt .Sprintf ("%s=%s" , imgspec .AnnotationTitle , title )
122
+ podmanTest .PodmanExitCleanly ("artifact" , "add" , "--annotation" , annotation3 , artifact2Name , artifact1File )
123
+ a = podmanTest .InspectArtifact (artifact2Name )
124
+ Expect (a .Manifest .Layers [0 ].Annotations [imgspec .AnnotationTitle ]).To (Equal (title ))
121
125
})
122
126
123
127
It ("podman artifact add multiple" , func () {
@@ -480,9 +484,9 @@ var _ = Describe("Podman artifact", func() {
480
484
Expect (a .Manifest .Layers ).To (HaveLen (3 ))
481
485
482
486
for _ , l := range a .Manifest .Layers {
483
- layersNames [l .Annotations ["org.opencontainers.image.title" ]] += 1
487
+ layersNames [l.Annotations [imgspec. AnnotationTitle ]] += 1
484
488
485
- if l .Annotations ["org.opencontainers.image.title" ] == filepath .Base (artifact3File ) {
489
+ if l .Annotations [imgspec . AnnotationTitle ] == filepath .Base (artifact3File ) {
486
490
Expect (l .Annotations ["color" ]).To (Equal ("blue" ))
487
491
} else {
488
492
Expect (l .Annotations ).To (HaveLen (1 ))
0 commit comments