File tree Expand file tree Collapse file tree 4 files changed +19
-4
lines changed Expand file tree Collapse file tree 4 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -453,7 +453,7 @@ Amazing entities that [sponsor](https://github.com/sponsors/apocas) my open-sour
453
453
454
454
### Image
455
455
456
- - image.inspect() - [ Docker API Endpoint] ( https://docs.docker.com/engine/api/v1.37/# operation/ImageInspect )
456
+ - image.inspect(options ) - [ Docker API Endpoint] ( https://docs.docker.com/engine/api/v1.48/#tag/Image/ operation/ImageInspect )
457
457
- image.history() - [ Docker API Endpoint] ( https://docs.docker.com/engine/api/v1.37/#operation/ImageHistory )
458
458
- image.push(options, callback, auth) - [ Docker API Endpoint] ( https://docs.docker.com/engine/api/v1.37/#operation/ImagePush )
459
459
- image.tag(options) - [ Docker API Endpoint] ( https://docs.docker.com/engine/api/v1.37/#operation/ImageTag )
Original file line number Diff line number Diff line change @@ -14,15 +14,18 @@ Image.prototype[require('util').inspect.custom] = function() { return this; };
14
14
15
15
/**
16
16
* Inspect
17
+ * @param {Object } opts Inspect options, only 'manifests' (optional)
17
18
* @param {Function } callback Callback, if specified Docker will be queried.
18
19
* @return {Object } Name only if callback isn't specified.
19
20
*/
20
- Image . prototype . inspect = function ( callback ) {
21
+ Image . prototype . inspect = function ( opts , callback ) {
22
+ var args = util . processArgs ( opts , callback ) ;
21
23
var self = this ;
22
24
23
25
var opts = {
24
26
path : '/images/' + this . name + '/json' ,
25
27
method : 'GET' ,
28
+ options : args . opts ,
26
29
statusCodes : {
27
30
200 : true ,
28
31
404 : 'no such image' ,
Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ describe("#docker", function() {
273
273
} ) ;
274
274
275
275
stream . on ( "end" , function ( ) {
276
- docker . getImage ( randomId ) . inspect ( ( err , image ) => {
276
+ docker . getImage ( randomId ) . inspect ( undefined , ( err , image ) => {
277
277
expect ( err ) . to . be . null ;
278
278
expect ( image ) . to . exist ;
279
279
done ( ) ;
Original file line number Diff line number Diff line change @@ -17,7 +17,19 @@ describe("#image", function() {
17
17
done ( ) ;
18
18
}
19
19
20
- image . inspect ( handler ) ;
20
+ image . inspect ( undefined , handler ) ;
21
+ } ) ;
22
+
23
+ it ( "should inspect an image with manifest" , function ( done ) {
24
+ var image = docker . getImage ( testImage ) ;
25
+
26
+ function handler ( err , data ) {
27
+ expect ( err ) . to . be . null ;
28
+ expect ( data ) . to . be . ok ;
29
+ done ( ) ;
30
+ }
31
+
32
+ image . inspect ( { manifest : 1 } , handler ) ;
21
33
} ) ;
22
34
} ) ;
23
35
You can’t perform that action at this time.
0 commit comments