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 <kb2ma@runbox.com>
  • Loading branch information
kb2ma committed Apr 29, 2024
1 parent 10ca5b4 commit aa9a148
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 198 deletions.
217 changes: 26 additions & 191 deletions npm-shrinkwrap.json

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

8 changes: 4 additions & 4 deletions package.json
Expand Up @@ -129,7 +129,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 @@ -198,7 +198,7 @@
"typescript": "^5.3.2"
},
"dependencies": {
"@balena/compose": "^3.2.0",
"@balena/compose": "^3.2.1",
"@balena/dockerignore": "^1.0.2",
"@balena/env-parsing": "^1.1.8",
"@balena/es-version": "^1.0.1",
Expand Down Expand Up @@ -227,9 +227,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.8",
"event-stream": "3.3.4",
Expand Down
20 changes: 17 additions & 3 deletions tests/utils/docker.spec.ts
Expand Up @@ -29,7 +29,7 @@ const defaultSocketPath =
: '/var/run/docker.sock';

describe('getDefaultDockerModemOpts() function', function () {
it('should use a Unix socket when --dockerHost is not used', () => {
it('should use a Unix socket when --dockerHost is not used', async () => {
const cliFlags: DockerConnectionCliFlags = {
dockerPort: 2376,
};
Expand All @@ -38,8 +38,15 @@ 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;
expect(await socketPath()).to.equal(defaultSocketPath);
} else {
expect(defaultOps.socketPath).to.equal(defaultSocketPath);
}
});

it('should use the HTTP protocol when --dockerPort is 2375', () => {
Expand Down Expand Up @@ -131,7 +138,14 @@ 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;
expect(await socketPath()).to.equal(defaultSocketPath);
} else {
expect(connectOpts.socketPath).to.equal(defaultSocketPath);
}
});
});

0 comments on commit aa9a148

Please sign in to comment.