diff --git a/package-lock.json b/package-lock.json index 27fae71c..c22c1a08 100644 --- a/package-lock.json +++ b/package-lock.json @@ -102,9 +102,9 @@ "dev": true }, "@types/dockerode": { - "version": "2.5.10", - "resolved": "https://registry.npmjs.org/@types/dockerode/-/dockerode-2.5.10.tgz", - "integrity": "sha512-Aiy0iYuWudPOHNc69LYHCfvjzvJ0KaRIkM9o6unMQSOh7rp7/KydUVb5KRGRSoRk9V7uWv9IssEi/ahF4yaOkA==", + "version": "2.5.13", + "resolved": "https://registry.npmjs.org/@types/dockerode/-/dockerode-2.5.13.tgz", + "integrity": "sha512-TgSP2nhCZgKOYcuMyuUs1SvLWZCd20z6SczPadLL11iCEEMDiblE23cwIyc1BR7FPpntwT9Z+IcdFNAXUAKmKQ==", "dev": true, "requires": { "@types/node": "*" diff --git a/package.json b/package.json index fc72a036..9b4979df 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "devDependencies": { "@types/bluebird": "^3.5.25", "@types/common-tags": "^1.8.0", - "@types/dockerode": "^2.5.10", + "@types/dockerode": "^2.5.13", "@types/event-stream": "^3.3.34", "@types/express": "^4.11.1", "@types/knex": "^0.14.14", diff --git a/src/compose/volumes.ts b/src/compose/volumes.ts index 503e17c0..40383415 100644 --- a/src/compose/volumes.ts +++ b/src/compose/volumes.ts @@ -203,20 +203,13 @@ export class Volumes { } private async listWithBothLabels(): Promise { - // We have to cast the listVolumes call from any[] to any below, until the - // relevant PR: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/32383 - // is merged and released - we can also replace Dockerode here with the Docker - // DockerUtils class imported above - const [legacyResponse, currentResponse]: [ - Dockerode.VolumeInfoList, - Dockerode.VolumeInfoList - ] = await Promise.all([ + const [legacyResponse, currentResponse] = await Promise.all([ this.docker.listVolumes({ filters: { label: ['io.resin.supervised'] }, - }) as Promise, + }), this.docker.listVolumes({ filters: { label: ['io.balena.supervised'] }, - }) as Promise, + }), ]); const legacyVolumes = _.get(legacyResponse, 'Volumes', []); diff --git a/typings/dockerode-ext.d.ts b/typings/dockerode-ext.d.ts index cc3c5ea9..2655c916 100644 --- a/typings/dockerode-ext.d.ts +++ b/typings/dockerode-ext.d.ts @@ -21,27 +21,4 @@ declare module 'dockerode' { Healthcheck?: DockerHealthcheck; StopTimeout?: number; } - - // TODO: Once https://github.com/DefinitelyTyped/DefinitelyTyped/pull/32383 - // is merged and released, remove this and VolumeInfoList - export interface VolumeInspectInfo { - Name: string; - Driver: string; - Mountpoint: string; - Status?: { [key: string]: string }; - Labels: { [key: string]: string }; - Scope: 'local' | 'global'; - // Field is always present, but sometimes is null - Options: { [key: string]: string } | null; - // Field is sometimes present, and sometimes null - UsageData?: { - Size: number; - RefCount: number; - } | null; - } - - export interface VolumeInfoList { - Volumes: Dockerode.VolumeInspectInfo[]; - Warnings: string[]; - } }