Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change run commands to use imageId instead of tag #4112

Merged
merged 4 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1615,7 +1615,7 @@
"type": "string"
}
],
"default": "${containerCommand} run --rm -d ${exposedPorts} ${tag}",
"default": "${containerCommand} run --rm -d ${exposedPorts} ${imageId}",
jnsjunior marked this conversation as resolved.
Show resolved Hide resolved
"description": "%vscode-docker.config.template.run.description%"
},
"docker.commands.runInteractive": {
Expand Down Expand Up @@ -1647,7 +1647,7 @@
"type": "string"
}
],
"default": "${containerCommand} run --rm -it ${exposedPorts} ${tag}",
"default": "${containerCommand} run --rm -it ${exposedPorts} ${imageId}",
"description": "%vscode-docker.config.template.runInteractive.description%"
},
"docker.commands.attach": {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/images/runImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ async function runImageCore(context: IActionContext, node: ImageTreeItem | undef

const terminalCommand = await selectRunCommand(
context,
node.fullTag,
node.imageId,
interactive,
inspectResult?.[0]?.ports
);

const taskCRF = new TaskCommandRunnerFactory(
{
taskName: node.fullTag,
taskName: node.imageId,
alwaysRunNew: interactive,
}
);
Expand Down
6 changes: 3 additions & 3 deletions src/commands/selectCommandTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export async function selectBuildCommand(context: IActionContext, folder: vscode
);
}

export async function selectRunCommand(context: IActionContext, fullTag: string, interactive: boolean, exposedPorts?: PortBinding[]): Promise<VoidCommandResponse> {
export async function selectRunCommand(context: IActionContext, imageId: string, interactive: boolean, exposedPorts?: PortBinding[]): Promise<VoidCommandResponse> {
jnsjunior marked this conversation as resolved.
Show resolved Hide resolved
let portsString: string = '';
if (exposedPorts) {
portsString = exposedPorts.map(pb => `-p ${pb.containerPort}:${pb.containerPort}${pb.protocol ? '/' + pb.protocol : ''}`).join(' ');
Expand All @@ -47,9 +47,9 @@ export async function selectRunCommand(context: IActionContext, fullTag: string,
return await selectCommandTemplate(
context,
interactive ? 'runInteractive' : 'run',
[fullTag],
[imageId],
jnsjunior marked this conversation as resolved.
Show resolved Hide resolved
undefined,
{ 'tag': fullTag, 'exposedPorts': portsString, 'containerCommand': await ext.runtimeManager.getCommand() }
{ 'imageId': imageId, 'exposedPorts': portsString, 'containerCommand': await ext.runtimeManager.getCommand() }
jnsjunior marked this conversation as resolved.
Show resolved Hide resolved
);
}

Expand Down