@@ -117,6 +117,43 @@ describe('create', () => {
117117 expect ( result ) . toBeUndefined ( ) ;
118118 } ) ;
119119
120+ it ( 'passes annotations to imagetools create' , async ( ) => {
121+ const getCommand = vi . fn ( ) . mockResolvedValue ( {
122+ command : 'docker' ,
123+ args : [ 'buildx' , 'imagetools' , 'create' ]
124+ } ) ;
125+ const buildx = { getCommand} as unknown as Buildx ;
126+
127+ const execSpy = vi . spyOn ( Exec , 'getExecOutput' ) . mockResolvedValue ( {
128+ exitCode : 0 ,
129+ stdout : '' ,
130+ stderr : ''
131+ } ) ;
132+
133+ const result = await new ImageTools ( { buildx} ) . create ( {
134+ sources : [ 'docker.io/library/alpine:latest' ] ,
135+ annotations : [ 'index:org.opencontainers.image.title=Alpine' , 'manifest-descriptor:org.opencontainers.image.description=Base image' ] ,
136+ silent : true
137+ } ) ;
138+
139+ expect ( getCommand ) . toHaveBeenCalledWith ( [
140+ 'imagetools' ,
141+ 'create' ,
142+ '--annotation' ,
143+ 'index:org.opencontainers.image.title=Alpine' ,
144+ '--annotation' ,
145+ 'manifest-descriptor:org.opencontainers.image.description=Base image' ,
146+ '--metadata-file' ,
147+ metadataFile ,
148+ 'docker.io/library/alpine:latest'
149+ ] ) ;
150+ expect ( execSpy ) . toHaveBeenCalledWith ( 'docker' , [ 'buildx' , 'imagetools' , 'create' ] , {
151+ ignoreReturnCode : true ,
152+ silent : true
153+ } ) ;
154+ expect ( result ) . toBeUndefined ( ) ;
155+ } ) ;
156+
120157 it ( 'skips command execution when skipExec is enabled' , async ( ) => {
121158 const getCommand = vi . fn ( ) . mockResolvedValue ( {
122159 command : 'docker' ,
0 commit comments