Comparing version 2.2.7 to 2.2.8
@@ -39,10 +39,14 @@ var extend = require('./util').extend, | ||
* Inspect | ||
* @param {Options} opts Options (optional) | ||
* @param {Function} callback Callback, if supplied will query Docker. | ||
* @return {Object} ID only and only if callback isn't supplied. | ||
*/ | ||
Container.prototype.inspect = function(callback) { | ||
if (typeof callback === 'function') { | ||
Container.prototype.inspect = function(opts, callback) { | ||
var args = util.processArgs(opts, callback); | ||
if (typeof args.callback === 'function') { | ||
var optsf = { | ||
path: '/containers/' + this.id + '/json', | ||
path: '/containers/' + this.id + '/json?', | ||
method: 'GET', | ||
options: args.opts, | ||
statusCodes: { | ||
@@ -56,3 +60,3 @@ 200: true, | ||
this.modem.dial(optsf, function(err, data) { | ||
callback(err, data); | ||
args.callback(err, data); | ||
}); | ||
@@ -67,6 +71,6 @@ } else { | ||
/** | ||
* Rename | ||
* @param {Object} opts Rename options | ||
* @param {Function} callback Callback | ||
*/ | ||
* Rename | ||
* @param {Object} opts Rename options | ||
* @param {Function} callback Callback | ||
*/ | ||
Container.prototype.rename = function(opts, callback) { | ||
@@ -255,3 +259,3 @@ var args = util.processArgs(opts, callback, this.defaultOptions.rename); | ||
this.modem.dial(optsf, function(err, data) { | ||
if(err) return args.callback(err, data); | ||
if (err) return args.callback(err, data); | ||
args.callback(err, new Exec(self.modem, data.Id)); | ||
@@ -469,3 +473,3 @@ }); | ||
Container.prototype.copy = function(opts, callback) { | ||
console.log('container.copy is depreacted since Docker v1.8.x'); | ||
console.log('container.copy is deprecated since Docker v1.8.x'); | ||
var args = util.processArgs(opts, callback, this.defaultOptions.copy); | ||
@@ -570,3 +574,2 @@ | ||
/** | ||
@@ -598,6 +601,6 @@ * Container logs | ||
/** | ||
* Container stats | ||
* @param {Object} opts Stats options. (optional) | ||
* @param {Function} callback Callback with data | ||
*/ | ||
* Container stats | ||
* @param {Object} opts Stats options. (optional) | ||
* @param {Function} callback Callback with data | ||
*/ | ||
Container.prototype.stats = function(opts, callback) { | ||
@@ -604,0 +607,0 @@ var args = util.processArgs(opts, callback, this.defaultOptions.stats); |
@@ -37,3 +37,3 @@ var EventEmitter = require('events').EventEmitter, | ||
this.modem.dial(optsf, function(err, data) { | ||
if(err) return callback(err, data); | ||
if (err) return callback(err, data); | ||
callback(err, self.getContainer(data.Id)); | ||
@@ -151,11 +151,13 @@ }); | ||
if(opts.registryconfig) { | ||
optsf.registryconfig = optsf.options.registryconfig; | ||
delete optsf.options.registryconfig; | ||
} | ||
if (opts) { | ||
if (opts.registryconfig) { | ||
optsf.registryconfig = optsf.options.registryconfig; | ||
delete optsf.options.registryconfig; | ||
} | ||
//undocumented? | ||
if(opts.authconfig) { | ||
optsf.authconfig = optsf.options.authconfig; | ||
delete optsf.options.authconfig; | ||
//undocumented? | ||
if (opts.authconfig) { | ||
optsf.authconfig = optsf.options.authconfig; | ||
delete optsf.options.authconfig; | ||
} | ||
} | ||
@@ -200,3 +202,2 @@ | ||
/** | ||
@@ -264,19 +265,19 @@ * Fetches an Exec instance by ID | ||
Docker.prototype.createVolume = function(opts, callback) { | ||
var args = util.processArgs(opts, callback); | ||
var self = this; | ||
var optsf = { | ||
path: '/volumes/create?', | ||
method: 'POST', | ||
options: args.opts, | ||
statusCodes: { | ||
200: true, // unofficial, but proxies may return it | ||
201: true, | ||
500: 'server error' | ||
} | ||
}; | ||
var args = util.processArgs(opts, callback); | ||
var self = this; | ||
var optsf = { | ||
path: '/volumes/create?', | ||
method: 'POST', | ||
options: args.opts, | ||
statusCodes: { | ||
200: true, // unofficial, but proxies may return it | ||
201: true, | ||
500: 'server error' | ||
} | ||
}; | ||
this.modem.dial(optsf, function(err, data) { | ||
if(err) return args.callback(err, data); | ||
args.callback(err, self.getVolume(data.Name)); | ||
}); | ||
this.modem.dial(optsf, function(err, data) { | ||
if (err) return args.callback(err, data); | ||
args.callback(err, self.getVolume(data.Name)); | ||
}); | ||
}; | ||
@@ -314,20 +315,20 @@ | ||
Docker.prototype.createNetwork = function(opts, callback) { | ||
var args = util.processArgs(opts, callback); | ||
var self = this; | ||
var optsf = { | ||
path: '/networks/create?', | ||
method: 'POST', | ||
options: args.opts, | ||
statusCodes: { | ||
200: true, // unofficial, but proxies may return it | ||
201: true, | ||
404: 'driver not found', | ||
500: 'server error' | ||
} | ||
}; | ||
var args = util.processArgs(opts, callback); | ||
var self = this; | ||
var optsf = { | ||
path: '/networks/create?', | ||
method: 'POST', | ||
options: args.opts, | ||
statusCodes: { | ||
200: true, // unofficial, but proxies may return it | ||
201: true, | ||
404: 'driver not found', | ||
500: 'server error' | ||
} | ||
}; | ||
this.modem.dial(optsf, function(err, data) { | ||
if(err) return args.callback(err, data); | ||
args.callback(err, self.getNetwork(data.Id)); | ||
}); | ||
this.modem.dial(optsf, function(err, data) { | ||
if (err) return args.callback(err, data); | ||
args.callback(err, self.getNetwork(data.Id)); | ||
}); | ||
}; | ||
@@ -359,3 +360,2 @@ | ||
/** | ||
@@ -485,3 +485,3 @@ * Search images | ||
var argsf = [args.opts, args.callback]; | ||
if(auth) { | ||
if (auth) { | ||
argsf = [auth, args.opts, args.callback]; | ||
@@ -519,3 +519,7 @@ } | ||
container.attach({stream: true, stdout: true, stderr: true}, function handler(err, stream) { | ||
container.attach({ | ||
stream: true, | ||
stdout: true, | ||
stderr: true | ||
}, function handler(err, stream) { | ||
if (err) return callback(err, null, container); | ||
@@ -527,5 +531,9 @@ | ||
if (streamo instanceof Array) { | ||
stream.on('end', function () { | ||
try { streamo[0].end(); } catch (e) {} | ||
try { streamo[1].end(); } catch (e) {} | ||
stream.on('end', function() { | ||
try { | ||
streamo[0].end(); | ||
} catch (e) {} | ||
try { | ||
streamo[1].end(); | ||
} catch (e) {} | ||
}); | ||
@@ -535,3 +543,5 @@ container.modem.demuxStream(stream, streamo[0], streamo[1]); | ||
stream.setEncoding('utf8'); | ||
stream.pipe(streamo, {end: true}); | ||
stream.pipe(streamo, { | ||
end: true | ||
}); | ||
} | ||
@@ -541,3 +551,3 @@ } | ||
container.start(startOptions, function(err, data) { | ||
if(err) return callback(err, data, container); | ||
if (err) return callback(err, data, container); | ||
@@ -544,0 +554,0 @@ container.wait(function(err, data) { |
@@ -0,0 +0,0 @@ var util = require('./util'); |
@@ -0,0 +0,0 @@ var util = require('./util'); |
@@ -0,0 +0,0 @@ var util = require('./util'); |
@@ -0,0 +0,0 @@ var util = require('./util'); |
{ | ||
"name": "dockerode", | ||
"description": "Docker Remote API module.", | ||
"version": "2.2.7", | ||
"version": "2.2.8", | ||
"author": "Pedro Dias <petermdias@gmail.com>", | ||
@@ -18,3 +18,3 @@ "maintainers": [ | ||
"dependencies": { | ||
"docker-modem": "0.2.x" | ||
"docker-modem": "0.3.x" | ||
}, | ||
@@ -21,0 +21,0 @@ "devDependencies": { |
@@ -0,0 +0,0 @@ # dockerode |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
54840
1496
+ Addeddebug@2.6.9(transitive)
+ Addeddocker-modem@0.3.7(transitive)
+ Addedms@2.0.0(transitive)
- Removeddebug@0.7.4(transitive)
- Removeddocker-modem@0.2.8(transitive)
- Removedfollow-redirects@0.0.3(transitive)
- Removedquerystring@0.2.0(transitive)
- Removedunderscore@1.13.7(transitive)
Updateddocker-modem@0.3.x