Skip to content

Commit

Permalink
docker/install: Remove deprecated version and channel
Browse files Browse the repository at this point in the history
Use InstallSource instead

Signed-off-by: Paweł Gronowski <[email protected]>
  • Loading branch information
vvoland committed Oct 16, 2024
1 parent a39e50f commit 369ee35
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
6 changes: 5 additions & 1 deletion __tests__/docker/install.test.itg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}}`
Expand Down
6 changes: 5 additions & 1 deletion __tests__/docker/install.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
11 changes: 2 additions & 9 deletions src/docker/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 369ee35

Please sign in to comment.