File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
interface/cli/commands/image Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -7,28 +7,29 @@ const { image } = require('../../../../logic').api;
77
88const tag = new Command ( {
99 root : true ,
10- command : 'tag <id>' ,
10+ command : 'tag <id> [tags..] ' ,
1111 description : 'Add an image tag' ,
1212 builder : ( yargs ) => {
1313 yargs
14- . option ( 'tag' , {
15- describe : 'image tags' ,
16- type : 'array' ,
17- require : true ,
14+ . positional ( 'id' , {
15+ description : 'Docker image id' ,
16+ } )
17+ . positional ( 'names' , {
18+ description : 'Tag names' ,
1819 } ) ;
1920
2021 return yargs ;
2122 } ,
2223 handler : async ( argv ) => {
2324 const imageId = argv . id ;
24- const tags = _ . isArray ( argv . tag ) ? argv . tag : [ argv . tag ] ;
25+ const tags = argv . tags ;
2526 for ( let i = 0 ; i < tags . length ; i += 1 ) {
2627 const tag = tags [ i ] ;
2728 await image . addImageTag ( {
2829 imageId,
2930 tag,
3031 } ) ;
31- console . log ( `tag : ${ tag } successfully added to image ${ imageId } ` ) ;
32+ console . log ( `Tag : ${ tag } was added successfully to image: ${ imageId } ` ) ;
3233 }
3334 } ,
3435} ) ;
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ const annotateImage = async (dockerImageId, annotations) => {
136136} ;
137137
138138const addImageTag = async ( options ) => {
139- const image = await getImageById ( options . imageId ) ;
139+ const image = await getImageById ( { imageId : options . imageId } ) ;
140140 const imageId = image [ 0 ] . info . _id ;
141141 const RequestOptions = {
142142 url : `/api/images/${ encodeURIComponent ( imageId ) } /tag/${ options . tag } ` ,
You can’t perform that action at this time.
0 commit comments