docker/install: Remove deprecated version and channel

Use InstallSource instead

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2024-10-15 12:38:25 +02:00
parent b8a96071a8
commit de390e0872
No known key found for this signature in database
GPG Key ID: B85EFCFE26DEF92A
3 changed files with 12 additions and 11 deletions

View File

@ -55,7 +55,11 @@ aarch64:https://cloud.debian.org/images/cloud/bookworm/20231013-1532/debian-12-g
} }
await expect((async () => { await expect((async () => {
const install = new Install({ const install = new Install({
source: {
type: 'archive',
version: version, version: version,
channel: 'stable',
},
runDir: tmpDir, runDir: tmpDir,
contextName: 'foo', contextName: 'foo',
daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}` daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`

View File

@ -40,7 +40,11 @@ describe('download', () => {
'acquires %p of docker (%s)', async (version, platformOS) => { 'acquires %p of docker (%s)', async (version, platformOS) => {
jest.spyOn(osm, 'platform').mockImplementation(() => platformOS as NodeJS.Platform); jest.spyOn(osm, 'platform').mockImplementation(() => platformOS as NodeJS.Platform);
const install = new Install({ const install = new Install({
source: {
type: 'archive',
version: version, version: version,
channel: 'stable',
},
runDir: tmpDir, runDir: tmpDir,
}); });
const toolPath = await install.download(); const toolPath = await install.download();

View File

@ -51,13 +51,6 @@ export type InstallSource = InstallSourceImage | InstallSourceArchive;
export interface InstallOpts { export interface InstallOpts {
source?: InstallSource; source?: InstallSource;
// @deprecated
// Use `source = InstallSourceTypeArchive{version: ..., channel: ...}` instead
version?: string;
// @deprecated
// Use `source = InstallSourceTypeArchive{version: ..., channel: ...}` instead
channel?: string;
// ... // ...
runDir: string; runDir: string;
contextName?: string; contextName?: string;
@ -84,8 +77,8 @@ export class Install {
this.runDir = opts.runDir; this.runDir = opts.runDir;
this.source = opts.source || { this.source = opts.source || {
type: 'archive', type: 'archive',
version: opts.version || 'latest', version: 'latest',
channel: opts.channel || 'stable' channel: 'stable'
}; };
this.contextName = opts.contextName || 'setup-docker-action'; this.contextName = opts.contextName || 'setup-docker-action';
this.daemonConfig = opts.daemonConfig; this.daemonConfig = opts.daemonConfig;