Skip to content

Commit

Permalink
Upgrade dockerode and docker-modem dependencies
Browse files Browse the repository at this point in the history
Includes test fixes due to an interface change in docker-modem.

Change-type: patch
Signed-off-by: Ken Bannister <[email protected]>
  • Loading branch information
kb2ma committed Feb 11, 2024
1 parent 9e4dd3f commit cdc46ba
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 86 deletions.
179 changes: 99 additions & 80 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"@types/cli-truncate": "^2.0.0",
"@types/common-tags": "^1.8.1",
"@types/diff": "^5.0.3",
"@types/dockerode": "^3.3.9",
"@types/dockerode": "^3.3.23",
"@types/ejs": "^3.1.0",
"@types/express": "^4.17.13",
"@types/fs-extra": "^9.0.13",
Expand Down Expand Up @@ -224,9 +224,9 @@
"columnify": "^1.5.2",
"common-tags": "^1.7.2",
"denymount": "^2.3.0",
"docker-modem": "3.0.0",
"docker-modem": "^5.0.3",
"docker-progress": "^5.1.3",
"dockerode": "3.3.3",
"dockerode": "^4.0.2",
"ejs": "^3.1.6",
"etcher-sdk": "9.0.6",
"event-stream": "3.3.4",
Expand Down
28 changes: 25 additions & 3 deletions tests/utils/docker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { expect } from 'chai';
import { expect, assert } from 'chai';

import {
DockerConnectionCliFlags,
Expand All @@ -38,8 +38,19 @@ describe('getDefaultDockerModemOpts() function', function () {
host: undefined,
port: undefined,
protocol: 'http',
socketPath: defaultSocketPath,
});
if (typeof defaultOps.socketPath === 'function') {
// Function is always findDefaultUnixSocket(), which returns a promise.
// Must override type since @types/dockerode not updated yet.
const socketPath: () => Promise<string> = defaultOps.socketPath;
socketPath()
.then((socketPathRes) =>
expect(socketPathRes).to.equal(defaultSocketPath),
)
.catch((e) => assert.fail(`socketPath() failed: ${e}`));
} else {
expect(defaultOps.socketPath).to.equal(defaultSocketPath);
}
});

it('should use the HTTP protocol when --dockerPort is 2375', () => {
Expand Down Expand Up @@ -131,7 +142,18 @@ describe('generateConnectOpts() function', function () {
host: undefined,
port: undefined,
protocol: 'https',
socketPath: defaultSocketPath,
});
if (typeof connectOpts.socketPath === 'function') {
// Function is always findDefaultUnixSocket(), which returns a promise.
// Must override type since @types/dockerode not updated yet.
const socketPath: () => Promise<string> = connectOpts.socketPath;
socketPath()
.then((socketPathRes) =>
expect(socketPathRes).to.equal(defaultSocketPath),
)
.catch((e) => assert.fail(`socketPath() failed: ${e}`));
} else {
expect(connectOpts.socketPath).to.equal(defaultSocketPath);
}
});
});

0 comments on commit cdc46ba

Please sign in to comment.