From de390e08725cac0ad54c04f9c1488e9876b64314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Tue, 15 Oct 2024 12:38:25 +0200 Subject: [PATCH] docker/install: Remove deprecated version and channel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use InstallSource instead Signed-off-by: Paweł Gronowski --- __tests__/docker/install.test.itg.ts | 6 +++++- __tests__/docker/install.test.ts | 6 +++++- src/docker/install.ts | 11 ++--------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/__tests__/docker/install.test.itg.ts b/__tests__/docker/install.test.itg.ts index 679fa85..911d758 100644 --- a/__tests__/docker/install.test.itg.ts +++ b/__tests__/docker/install.test.itg.ts @@ -55,7 +55,11 @@ aarch64:https://cloud.debian.org/images/cloud/bookworm/20231013-1532/debian-12-g } await expect((async () => { const install = new Install({ - version: version, + source: { + type: 'archive', + version: version, + channel: 'stable', + }, runDir: tmpDir, contextName: 'foo', daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}` diff --git a/__tests__/docker/install.test.ts b/__tests__/docker/install.test.ts index 80ecc29..28e2b5a 100644 --- a/__tests__/docker/install.test.ts +++ b/__tests__/docker/install.test.ts @@ -40,7 +40,11 @@ describe('download', () => { 'acquires %p of docker (%s)', async (version, platformOS) => { jest.spyOn(osm, 'platform').mockImplementation(() => platformOS as NodeJS.Platform); const install = new Install({ - version: version, + source: { + type: 'archive', + version: version, + channel: 'stable', + }, runDir: tmpDir, }); const toolPath = await install.download(); diff --git a/src/docker/install.ts b/src/docker/install.ts index 1c35589..e6f219f 100644 --- a/src/docker/install.ts +++ b/src/docker/install.ts @@ -51,13 +51,6 @@ export type InstallSource = InstallSourceImage | InstallSourceArchive; export interface InstallOpts { source?: InstallSource; - // @deprecated - // Use `source = InstallSourceTypeArchive{version: ..., channel: ...}` instead - version?: string; - // @deprecated - // Use `source = InstallSourceTypeArchive{version: ..., channel: ...}` instead - channel?: string; - // ... runDir: string; contextName?: string; @@ -84,8 +77,8 @@ export class Install { this.runDir = opts.runDir; this.source = opts.source || { type: 'archive', - version: opts.version || 'latest', - channel: opts.channel || 'stable' + version: 'latest', + channel: 'stable' }; this.contextName = opts.contextName || 'setup-docker-action'; this.daemonConfig = opts.daemonConfig;