Skip to content

Commit

Permalink
Revert "Fix arm-containerservice deprecated pacakages warning. (#23)" (
Browse files Browse the repository at this point in the history
  • Loading branch information
Tatsinnit authored Jun 10, 2020
1 parent 292e4b7 commit 064eaab
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 142 deletions.
201 changes: 70 additions & 131 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@
"vscode": "^1.1.6"
},
"dependencies": {
"@azure/arm-containerservice": "11.0.0",
"@azure/arm-containerservice": "^7.0.1",
"azure-arm-containerservice": "^7.0.0",
"azure-arm-resource": "^7.3.0",
"handlebars": "^4.7.6",
"js-yaml": "^3.13.1",
"ms-rest": "^2.5.0",
"ms-rest-azure": "^2.6.0",
"vscode-azureextensionui": "^0.27.1",
"vscode-kubernetes-tools-api": "^1.0.0"
},
Expand Down
10 changes: 2 additions & 8 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as vscode from 'vscode';
import * as k8s from 'vscode-kubernetes-tools-api';
import * as azcs from '@azure/arm-containerservice';
import * as msRestJs from "@azure/ms-rest-js";
import * as azcs from 'azure-arm-containerservice'; // deprecated, but @azure/arm-containerservice doesn't play nicely with AzureAccount, so...

import { parseResource } from './azure-api-utils';
import AksClusterTreeItem from './tree/aksClusterTreeItem';
Expand Down Expand Up @@ -48,8 +47,7 @@ async function getClusterKubeconfig(target: AksClusterTreeItem): Promise<string
vscode.window.showErrorMessage(`Invalid ARM id ${target.id}`);
return;
}

const client = new azcs.ContainerServiceClient(restJSCredentialsFrom(target), target.root.subscriptionId); // TODO: safely
const client = new azcs.ContainerServiceClient(target.root.credentials, target.root.subscriptionId); // TODO: safely
try {
const accessProfile = await client.managedClusters.getAccessProfile(resourceGroupName, name, 'clusterUser');
const kubeconfig = accessProfile.kubeConfig!.toString(); // TODO: safely
Expand All @@ -59,7 +57,3 @@ async function getClusterKubeconfig(target: AksClusterTreeItem): Promise<string
return undefined;
}
}

function restJSCredentialsFrom(target: AksClusterTreeItem) {
return <msRestJs.ServiceClientCredentials><unknown>target.root.credentials;
}
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"target": "es6",
"outDir": "out",
"lib": [
"es6",
"DOM"
"es6"
],
"sourceMap": true,
"rootDir": "src",
Expand Down

0 comments on commit 064eaab

Please sign in to comment.