Skip to content

Commit

Permalink
docker.pull refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
apocas committed May 13, 2015
1 parent b303795 commit df15297
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
17 changes: 3 additions & 14 deletions lib/docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,23 +352,12 @@ Docker.prototype.pull = function(repoTag, opts, callback) {
callback = opts;
opts = {};
}
var authconfig = opts.authconfig || false;
delete opts.authconfig;

var imageSrc = util.parseRepositoryTag(repoTag);
var pullOpts = {
fromImage: imageSrc.repository,
tag: imageSrc.tag
};

// allow overriding the pull opts
extend(pullOpts, opts);
opts.fromImage = imageSrc.repository;
opts.tag = imageSrc.tag;

var args = [pullOpts, callback];
// Remove authconfig if set
if (authconfig) {
args.unshift(authconfig);
}
var args = [opts, callback];
return this.createImage.apply(this, args);
};

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 Remote API module.",
"version": "2.1.2",
"version": "2.1.3",
"author": "Pedro Dias <[email protected]>",
"maintainers": [
"apocas <[email protected]>"
Expand Down

0 comments on commit df15297

Please sign in to comment.