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

Remove ACI features #3642

Merged
merged 2 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
52 changes: 14 additions & 38 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
"onCommand:vscode-docker.registries.copyRemoteFullTag",
"onCommand:vscode-docker.registries.deleteImage",
"onCommand:vscode-docker.registries.deployImageToAzure",
"onCommand:vscode-docker.registries.deployImageToAci",
"onCommand:vscode-docker.registries.disconnectRegistry",
"onCommand:vscode-docker.registries.dockerHub.openInBrowser",
"onCommand:vscode-docker.registries.help",
Expand All @@ -118,7 +117,6 @@
"onCommand:vscode-docker.contexts.configureExplorer",
"onCommand:vscode-docker.contexts.refresh",
"onCommand:vscode-docker.contexts.help",
"onCommand:vscode-docker.contexts.create.aci",
"onTaskType:docker-build",
"onTaskType:docker-run",
"onTaskType:docker-compose",
Expand Down Expand Up @@ -301,7 +299,7 @@
"view/title": [
{
"command": "vscode-docker.containers.prune",
"when": "view == dockerContainers && !vscode-docker:newSdkContext",
"when": "view == dockerContainers",
"group": "navigation@1"
},
{
Expand All @@ -321,12 +319,12 @@
},
{
"command": "vscode-docker.networks.create",
"when": "view == dockerNetworks && !vscode-docker:newSdkContext",
"when": "view == dockerNetworks",
"group": "navigation@1"
},
{
"command": "vscode-docker.networks.prune",
"when": "view == dockerNetworks && !vscode-docker:newSdkContext",
"when": "view == dockerNetworks",
"group": "navigation@2"
},
{
Expand All @@ -336,17 +334,17 @@
},
{
"command": "vscode-docker.images.prune",
"when": "view == dockerImages && !vscode-docker:newSdkContext",
"when": "view == dockerImages",
"group": "navigation@2"
},
{
"command": "vscode-docker.images.showDangling",
"when": "view == dockerImages && !vscode-docker:newSdkContext && !vscode-docker:danglingShown",
"when": "view == dockerImages && !vscode-docker:danglingShown",
"group": "navigation@3"
},
{
"command": "vscode-docker.images.hideDangling",
"when": "view == dockerImages && !vscode-docker:newSdkContext && vscode-docker:danglingShown",
"when": "view == dockerImages && vscode-docker:danglingShown",
"group": "navigation@3"
},
{
Expand Down Expand Up @@ -376,7 +374,7 @@
},
{
"command": "vscode-docker.volumes.prune",
"when": "view == dockerVolumes && !vscode-docker:newSdkContext",
"when": "view == dockerVolumes",
"group": "navigation@1"
},
{
Expand All @@ -389,11 +387,6 @@
"when": "view == dockerVolumes",
"group": "navigation@9"
},
{
"command": "vscode-docker.contexts.create.aci",
"when": "view == vscode-docker.views.dockerContexts && isAzureAccountInstalled",
"group": "navigation@1"
},
{
"command": "vscode-docker.contexts.configureExplorer",
"when": "view == vscode-docker.views.dockerContexts",
Expand Down Expand Up @@ -468,27 +461,27 @@
},
{
"command": "vscode-docker.containers.composeGroup.logs",
"when": "view == dockerContainers && viewItem =~ /composeGroup$/i && !vscode-docker:aciContext",
"when": "view == dockerContainers && viewItem =~ /composeGroup$/i",
"group": "composeGroup_1_general@1"
},
{
"command": "vscode-docker.containers.composeGroup.start",
"when": "view == dockerContainers && viewItem =~ /composeGroup$/i && !vscode-docker:aciContext",
"when": "view == dockerContainers && viewItem =~ /composeGroup$/i",
"group": "composeGroup_1_general@2"
},
{
"command": "vscode-docker.containers.composeGroup.stop",
"when": "view == dockerContainers && viewItem =~ /composeGroup$/i && !vscode-docker:aciContext",
"when": "view == dockerContainers && viewItem =~ /composeGroup$/i",
"group": "composeGroup_1_general@3"
},
{
"command": "vscode-docker.containers.composeGroup.restart",
"when": "view == dockerContainers && viewItem =~ /composeGroup$/i && !vscode-docker:aciContext",
"when": "view == dockerContainers && viewItem =~ /composeGroup$/i",
"group": "composeGroup_2_destructive@1"
},
{
"command": "vscode-docker.containers.composeGroup.down",
"when": "view == dockerContainers && viewItem =~ /composeGroup$/i && !vscode-docker:aciContext",
"when": "view == dockerContainers && viewItem =~ /composeGroup$/i",
"group": "composeGroup_2_destructive@2"
},
{
Expand Down Expand Up @@ -591,11 +584,6 @@
"when": "view == dockerRegistries && viewItem =~ /(DockerV2|DockerHubV2);Tag;/ && isAzureAccountInstalled",
"group": "regs_tag_1_general@4"
},
{
"command": "vscode-docker.registries.deployImageToAci",
"when": "view == dockerRegistries && viewItem =~ /(DockerV2|DockerHubV2);Tag;/ && isAzureAccountInstalled",
"group": "regs_tag_1_general@5"
},
{
"command": "vscode-docker.registries.azure.untagImage",
"when": "view == dockerRegistries && viewItem == azure;DockerV2;Tag;",
Expand Down Expand Up @@ -668,7 +656,7 @@
},
{
"command": "vscode-docker.volumes.inspect",
"when": "view == dockerVolumes && viewItem == volume && !vscode-docker:newSdkContext",
"when": "view == dockerVolumes && viewItem == volume",
"group": "volumes_1_general@1"
},
{
Expand Down Expand Up @@ -2713,11 +2701,6 @@
"title": "%vscode-docker.commands.registries.deployImageToAzure%",
"category": "%vscode-docker.commands.category.dockerRegistries%"
},
{
"command": "vscode-docker.registries.deployImageToAci",
"title": "%vscode-docker.commands.registries.deployImageToAci%",
"category": "%vscode-docker.commands.category.dockerRegistries%"
},
{
"command": "vscode-docker.registries.disconnectRegistry",
"title": "%vscode-docker.commands.registries.disconnectRegistry%",
Expand Down Expand Up @@ -2842,12 +2825,6 @@
"title": "%vscode-docker.commands.contexts.help%",
"category": "%vscode-docker.commands.category.contexts%",
"icon": "$(question)"
},
{
"command": "vscode-docker.contexts.create.aci",
"title": "%vscode-docker.commands.contexts.create.aci%",
"category": "%vscode-docker.commands.category.contexts%",
"icon": "$(add)"
}
],
"views": {
Expand Down Expand Up @@ -2999,8 +2976,7 @@
"id": "azDeploy",
"title": "%vscode-docker.walkthrough.dockerStart.azDeploy.title%",
"completionEvents": [
"onCommand:vscode-docker.registries.deployImageToAzure",
"onCommand:vscode-docker.registries.deployImageToACI"
"onCommand:vscode-docker.registries.deployImageToAzure"
],
"description": "%vscode-docker.walkthrough.dockerStart.azDeploy.description%",
"when": "isAzureAccountInstalled",
Expand Down
2 changes: 0 additions & 2 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@
"vscode-docker.commands.registries.copyRemoteFullTag": "Copy Full Tag",
"vscode-docker.commands.registries.deleteImage": "Delete Image...",
"vscode-docker.commands.registries.deployImageToAzure": "Deploy Image to Azure App Service...",
"vscode-docker.commands.registries.deployImageToAci": "Deploy Image to Azure Container Instances...",
"vscode-docker.commands.registries.disconnectRegistry": "Disconnect",
"vscode-docker.commands.registries.dockerHub.openInBrowser": "Open in Browser",
"vscode-docker.commands.registries.help": "Registries Help",
Expand All @@ -286,7 +285,6 @@
"vscode-docker.commands.contexts.configureExplorer": "Configure Explorer...",
"vscode-docker.commands.contexts.refresh": "Refresh",
"vscode-docker.commands.contexts.help": "Docker Context Help",
"vscode-docker.commands.contexts.create.aci": "Create Azure Container Instances Context...",
"vscode-docker.commands.category.docker": "Docker",
"vscode-docker.commands.category.dockerContainers": "Docker Containers",
"vscode-docker.commands.category.dockerImages": "Docker Images",
Expand Down
23 changes: 9 additions & 14 deletions src/commands/containers/attachShellContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,16 @@ export async function attachShellContainer(context: IActionContext, node?: Conta
// On Windows containers, always use cmd
shellCommand = 'cmd';
} else {
if (await ext.runtimeManager.contextManager.isInCloudContext()) {
// If it's ACI we have to do sh, because it's not possible to check if bash is present
// On Linux containers, check if bash is present
// If so use it, otherwise use sh
try {
// If this succeeds, bash is present (exit code 0)
await ext.runWithDefaultShell(client =>
client.execContainer({ container: node.containerId, interactive: true, command: ['sh', '-c', 'which bash'] })
);
shellCommand = 'bash';
} catch {
shellCommand = 'sh';
} else {
// On Linux containers, check if bash is present
// If so use it, otherwise use sh
try {
// If this succeeds, bash is present (exit code 0)
await ext.runWithDefaultShell(client =>
client.execContainer({ container: node.containerId, interactive: true, command: ['sh', '-c', 'which bash'] })
);
shellCommand = 'bash';
} catch {
shellCommand = 'sh';
}
}
}

Expand Down
36 changes: 0 additions & 36 deletions src/commands/containers/confirmAllAffectedContainers.ts

This file was deleted.

5 changes: 1 addition & 4 deletions src/commands/containers/restartContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { ext } from '../../extensionVariables';
import { localize } from '../../localize';
import { ContainerTreeItem } from '../../tree/containers/ContainerTreeItem';
import { multiSelectNodes } from '../../utils/multiSelectNodes';
import { confirmAllAffectedContainers } from './confirmAllAffectedContainers';

export async function restartContainer(context: IActionContext, node?: ContainerTreeItem, nodes?: ContainerTreeItem[]): Promise<void> {
nodes = await multiSelectNodes(
Expand All @@ -20,11 +19,9 @@ export async function restartContainer(context: IActionContext, node?: Container
nodes
);

const references = await confirmAllAffectedContainers(context, nodes);

await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: localize('vscode-docker.commands.containers.restart.restarting', 'Restarting Container(s)...') }, async () => {
await ext.runWithDefaultShell(client =>
client.restartContainers({ container: references })
client.restartContainers({ container: nodes.map(n => n.containerId) })
);
});
}
5 changes: 1 addition & 4 deletions src/commands/containers/startContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { ext } from '../../extensionVariables';
import { localize } from '../../localize';
import { ContainerTreeItem } from '../../tree/containers/ContainerTreeItem';
import { multiSelectNodes } from '../../utils/multiSelectNodes';
import { confirmAllAffectedContainers } from './confirmAllAffectedContainers';

export async function startContainer(context: IActionContext, node?: ContainerTreeItem, nodes?: ContainerTreeItem[]): Promise<void> {
nodes = await multiSelectNodes(
Expand All @@ -20,11 +19,9 @@ export async function startContainer(context: IActionContext, node?: ContainerTr
nodes
);

const references = await confirmAllAffectedContainers(context, nodes);

await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: localize('vscode-docker.commands.containers.start.starting', 'Starting Container(s)...') }, async () => {
await ext.runWithDefaultShell(client =>
client.startContainers({ container: references })
client.startContainers({ container: nodes.map(n => n.containerId) })
);
});
}
5 changes: 1 addition & 4 deletions src/commands/containers/stopContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { ext } from '../../extensionVariables';
import { localize } from '../../localize';
import { ContainerTreeItem } from '../../tree/containers/ContainerTreeItem';
import { multiSelectNodes } from '../../utils/multiSelectNodes';
import { confirmAllAffectedContainers } from './confirmAllAffectedContainers';

export async function stopContainer(context: IActionContext, node?: ContainerTreeItem, nodes?: ContainerTreeItem[]): Promise<void> {
nodes = await multiSelectNodes(
Expand All @@ -20,11 +19,9 @@ export async function stopContainer(context: IActionContext, node?: ContainerTre
nodes
);

const references = await confirmAllAffectedContainers(context, nodes);

await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, title: localize('vscode-docker.commands.containers.stop.stopping', 'Stopping Container(s)...') }, async () => {
await ext.runWithDefaultShell(client =>
client.stopContainers({ container: references })
client.stopContainers({ container: nodes.map(n => n.containerId) })
);
});
}
11 changes: 0 additions & 11 deletions src/commands/context/aci/createAciContext.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/commands/registerCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import { startContainer } from "./containers/startContainer";
import { stats } from "./containers/stats";
import { stopContainer } from "./containers/stopContainer";
import { viewContainerLogs } from "./containers/viewContainerLogs";
import { createAciContext } from "./context/aci/createAciContext";
import { configureDockerContextsExplorer, dockerContextsHelp } from "./context/DockerContextsViewCommands";
import { inspectDockerContext } from "./context/inspectDockerContext";
import { removeDockerContext } from "./context/removeDockerContext";
Expand Down Expand Up @@ -55,7 +54,6 @@ import { registerWorkspaceCommand } from "./registerWorkspaceCommand";
import { createAzureRegistry } from "./registries/azure/createAzureRegistry";
import { deleteAzureRegistry } from "./registries/azure/deleteAzureRegistry";
import { deleteAzureRepository } from "./registries/azure/deleteAzureRepository";
import { deployImageToAci } from "./registries/azure/deployImageToAci";
import { deployImageToAzure } from "./registries/azure/deployImageToAzure";
import { openInAzurePortal } from "./registries/azure/openInAzurePortal";
import { buildImageInAzure } from "./registries/azure/tasks/buildImageInAzure";
Expand Down Expand Up @@ -169,7 +167,6 @@ export function registerCommands(): void {
registerCommand('vscode-docker.registries.copyRemoteFullTag', copyRemoteFullTag);
registerCommand('vscode-docker.registries.deleteImage', deleteRemoteImage);
registerCommand('vscode-docker.registries.deployImageToAzure', deployImageToAzure);
registerCommand('vscode-docker.registries.deployImageToAci', deployImageToAci);
registerCommand('vscode-docker.registries.disconnectRegistry', disconnectRegistry);
registerCommand('vscode-docker.registries.help', registryHelp);
registerWorkspaceCommand('vscode-docker.registries.logInToDockerCli', logInToDockerCli);
Expand Down Expand Up @@ -202,7 +199,6 @@ export function registerCommands(): void {
registerCommand('vscode-docker.contexts.inspect', inspectDockerContext);
registerCommand('vscode-docker.contexts.remove', removeDockerContext);
registerCommand('vscode-docker.contexts.use', useDockerContext);
registerCommand('vscode-docker.contexts.create.aci', createAciContext);

registerLocalCommand('vscode-docker.installDocker', installDocker);

Expand Down
Loading