Skip to content

Commit

Permalink
Remote API v1.13 fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
apocas committed Jul 16, 2014
1 parent 20abf6d commit a9dce5c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 25 deletions.
8 changes: 5 additions & 3 deletions lib/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var _ = require('underscore');
var Container = function(modem, id) {
this.modem = modem;
this.id = id;

this.defaultOptions = {
top: {},
start: {},
Expand All @@ -15,7 +15,7 @@ var Container = function(modem, id) {
remove: {},
copy: {}
};

};

Container.prototype.inspect = function(callback) {
Expand Down Expand Up @@ -104,6 +104,7 @@ Container.prototype.start = function(opts, callback) {
method: 'POST',
statusCodes: {
204: true,
304: "container already started",
404: "no such container",
500: "server error"
},
Expand Down Expand Up @@ -150,6 +151,7 @@ Container.prototype.stop = function(opts, callback) {
method: 'POST',
statusCodes: {
204: true,
304: "container already stopped",
404: "no such container",
500: "server error"
},
Expand Down Expand Up @@ -258,7 +260,7 @@ Container.prototype.remove = function(opts, callback) {
callback = opts;
opts = {};
}

var optsf = {
path: '/containers/' + this.id + '?',
method: 'DELETE',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dockerode",
"description": "Docker.io / Docker remote API implementation.",
"version": "2.0.0",
"version": "2.0.1",
"author": "Pedro Dias <petermdias@gmail.com>",
"maintainers": [
"apocas <petermdias@gmail.com>"
Expand Down
27 changes: 6 additions & 21 deletions test/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,37 +244,22 @@ describe("#container", function() {
container.changes(handler);
});
});

describe("#logs", function() {

it("should get the logs for a container", function(done) {
this.timeout(30000);
var container = docker.getContainer(testContainer);
var logs_opts = { follow: false, stdout: true, stderr: true, timestamps: true };

function handler(err, logs) {
expect(err).to.be.null;
expect(logs).to.be.a('string');
done();
}

container.logs(logs_opts, handler);

});


it("should get the logs for a container as a stream", function(done) {
this.timeout(30000);
var container = docker.getContainer(testContainer);
var logs_opts = { follow: true, stdout: true, stderr: true, timestamps: true };

function handler(err, stream) {
expect(err).to.be.null;
expect(stream.pipe).to.be.ok;
done();
}

container.logs(logs_opts, handler);

});
});

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

function handler(err, data) {
expect(err).to.be.null;
expect(err).not.to.be.null;
done();
}

Expand Down

0 comments on commit a9dce5c

Please sign in to comment.