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

Revert "Fix arm-containerservice deprecated pacakages warning. (#23)" #27

Merged
merged 1 commit into from
Jun 10, 2020
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
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