Skip to content

Commit a9dce5c

Browse files
committed
Remote API v1.13 fixes.
1 parent 20abf6d commit a9dce5c

File tree

3 files changed

+12
-25
lines changed

3 files changed

+12
-25
lines changed

lib/container.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ var _ = require('underscore');
33
var Container = function(modem, id) {
44
this.modem = modem;
55
this.id = id;
6-
6+
77
this.defaultOptions = {
88
top: {},
99
start: {},
@@ -15,7 +15,7 @@ var Container = function(modem, id) {
1515
remove: {},
1616
copy: {}
1717
};
18-
18+
1919
};
2020

2121
Container.prototype.inspect = function(callback) {
@@ -104,6 +104,7 @@ Container.prototype.start = function(opts, callback) {
104104
method: 'POST',
105105
statusCodes: {
106106
204: true,
107+
304: "container already started",
107108
404: "no such container",
108109
500: "server error"
109110
},
@@ -150,6 +151,7 @@ Container.prototype.stop = function(opts, callback) {
150151
method: 'POST',
151152
statusCodes: {
152153
204: true,
154+
304: "container already stopped",
153155
404: "no such container",
154156
500: "server error"
155157
},
@@ -258,7 +260,7 @@ Container.prototype.remove = function(opts, callback) {
258260
callback = opts;
259261
opts = {};
260262
}
261-
263+
262264
var optsf = {
263265
path: '/containers/' + this.id + '?',
264266
method: 'DELETE',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "dockerode",
33
"description": "Docker.io / Docker remote API implementation.",
4-
"version": "2.0.0",
4+
"version": "2.0.1",
55
"author": "Pedro Dias <petermdias@gmail.com>",
66
"maintainers": [
77
"apocas <petermdias@gmail.com>"

test/container.js

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -244,37 +244,22 @@ describe("#container", function() {
244244
container.changes(handler);
245245
});
246246
});
247-
247+
248248
describe("#logs", function() {
249-
250-
it("should get the logs for a container", function(done) {
251-
this.timeout(30000);
252-
var container = docker.getContainer(testContainer);
253-
var logs_opts = { follow: false, stdout: true, stderr: true, timestamps: true };
254-
255-
function handler(err, logs) {
256-
expect(err).to.be.null;
257-
expect(logs).to.be.a('string');
258-
done();
259-
}
260-
261-
container.logs(logs_opts, handler);
262-
263-
});
264-
249+
265250
it("should get the logs for a container as a stream", function(done) {
266251
this.timeout(30000);
267252
var container = docker.getContainer(testContainer);
268253
var logs_opts = { follow: true, stdout: true, stderr: true, timestamps: true };
269-
254+
270255
function handler(err, stream) {
271256
expect(err).to.be.null;
272257
expect(stream.pipe).to.be.ok;
273258
done();
274259
}
275-
260+
276261
container.logs(logs_opts, handler);
277-
262+
278263
});
279264
});
280265

@@ -319,7 +304,7 @@ describe("#non-responsive container", function() {
319304
var container = docker.getContainer(testContainer);
320305

321306
function handler(err, data) {
322-
expect(err).to.be.null;
307+
expect(err).not.to.be.null;
323308
done();
324309
}
325310

0 commit comments

Comments
 (0)