1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Update @kubernetes/client-node to 0.11.1 (#278)

Signed-off-by: Lauri Nevala <lauri.nevala@gmail.com>
This commit is contained in:
Lauri Nevala 2020-04-20 16:17:59 +03:00 committed by GitHub
parent e7511a41ec
commit 01e2ef50b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 40 deletions

View File

@ -126,7 +126,7 @@
"dependencies": {
"@hapi/call": "^6.0.1",
"@hapi/subtext": "^6.1.2",
"@kubernetes/client-node": "0.11.0",
"@kubernetes/client-node": "0.11.1",
"@types/cookie": "^0.3.3",
"@types/fs-extra": "^8.0.0",
"@types/proper-lockfile": "^4.1.1",

View File

@ -1,30 +0,0 @@
diff --git a/node_modules/@kubernetes/client-node/dist/oidc_auth.js b/node_modules/@kubernetes/client-node/dist/oidc_auth.js
index a393b8d..652ce12 100644
--- a/node_modules/@kubernetes/client-node/dist/oidc_auth.js
+++ b/node_modules/@kubernetes/client-node/dist/oidc_auth.js
@@ -38,6 +38,7 @@ class OpenIDConnectAuth {
return null;
}
const client = overrideClient ? overrideClient : yield this.getClient(user);
+ client.CLOCK_TOLERANCE = 10;
return this.refresh(user, client);
});
}
@@ -46,6 +47,7 @@ class OpenIDConnectAuth {
if (Date.now() / 1000 > this.currentTokenExpiration) {
const newToken = yield client.refresh(user.authProvider.config['refresh-token']);
user.authProvider.config['id-token'] = newToken.id_token;
+ user.authProvider.config['refresh-token'] = newToken.refresh_token;
this.currentTokenExpiration = newToken.expires_at || 0;
}
return user.authProvider.config['id-token'];
@@ -53,6 +55,9 @@ class OpenIDConnectAuth {
}
getClient(user) {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
+ openid_client_1.Issuer.defaultHttpOptions = {
+ timeout: 10000
+ }
const oidcIssuer = yield openid_client_1.Issuer.discover(user.authProvider.config['idp-issuer-url']);
return new oidcIssuer.Client({
client_id: user.authProvider.config['client-id'],

View File

@ -62,7 +62,7 @@ export abstract class Feature {
const result = await client.deleteNamespace("lens-metrics", 'false', undefined, undefined, undefined, "Foreground");
const nsVersion = result.body.metadata.resourceVersion;
const nsWatch = new Watch(kc);
const req = nsWatch.watch('/api/v1/namespaces', {resourceVersion: nsVersion, fieldSelector: "metadata.name=lens-metrics"},
const req = await nsWatch.watch('/api/v1/namespaces', {resourceVersion: nsVersion, fieldSelector: "metadata.name=lens-metrics"},
(type, obj) => {
if(type === 'DELETED') {
logger.debug(`namespace ${name} finally gone`)

View File

@ -101,11 +101,11 @@ export class NodeShellSession extends ShellSession {
}
protected waitForRunningPod(podId: string) {
return new Promise<boolean>((resolve, reject) => {
return new Promise<boolean>(async (resolve, reject) => {
const kc = this.getKubeConfig();
const watch = new k8s.Watch(kc);
const req = watch.watch(`/api/v1/namespaces/kube-system/pods`, {},
const req = await watch.watch(`/api/v1/namespaces/kube-system/pods`, {},
// callback is called for each received object.
(_type, obj) => {
if (obj.metadata.name == podId && obj.status.phase === "Running") {

View File

@ -19,7 +19,7 @@ class ApiWatcher {
this.response = response
}
public start() {
public async start() {
if (this.processor) {
clearInterval(this.processor)
}
@ -28,7 +28,7 @@ class ApiWatcher {
events.map(event => this.sendEvent(event))
this.response.flushHeaders()
}, 50)
this.watchRequest = this.watch.watch(this.apiUrl, {}, this.watchHandler.bind(this), this.doneHandler.bind(this))
this.watchRequest = await this.watch.watch(this.apiUrl, {}, this.watchHandler.bind(this), this.doneHandler.bind(this))
}
public stop() {

View File

@ -1018,10 +1018,10 @@
"@types/istanbul-reports" "^1.1.1"
"@types/yargs" "^13.0.0"
"@kubernetes/client-node@0.11.0":
version "0.11.0"
resolved "https://registry.yarnpkg.com/@kubernetes/client-node/-/client-node-0.11.0.tgz#e85a8c970bf784c72ff4d7c63e158a1651ed5394"
integrity sha512-1DQG9rNgn1fNpfStCBnvErGMcuF29ixGuQAjh3CVPLCFVsQCtNQjbSOIEV7XV18YEa2fj2hLU52TmJMSII0Kzw==
"@kubernetes/client-node@0.11.1":
version "0.11.1"
resolved "https://registry.yarnpkg.com/@kubernetes/client-node/-/client-node-0.11.1.tgz#87ae6a8e4f3d1937acdda5ebc21ce49c18c820ae"
integrity sha512-0A4nwErxzJiGt3WYMR6rvcQF46hFz04b6uCmW7Kuj+Cl0zwe7KKxeMiqbZDtHPOq1CcOHOIcKNWCacUKL5CdxQ==
dependencies:
"@types/js-yaml" "^3.12.1"
"@types/node" "^10.12.0"
@ -1035,6 +1035,7 @@
jsonpath-plus "^0.19.0"
openid-client "2.5.0"
request "^2.88.0"
rfc4648 "^1.3.0"
shelljs "^0.8.2"
tslib "^1.9.3"
underscore "^1.9.1"
@ -9673,6 +9674,11 @@ retry@^0.12.0:
resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b"
integrity sha1-G0KmJmoh8HQh0bC1S33BZ7AcATs=
rfc4648@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/rfc4648/-/rfc4648-1.3.0.tgz#2a69c76f05bc0e388feab933672de9b492af95f1"
integrity sha512-x36K12jOflpm1V8QjPq3I+pt7Z1xzeZIjiC8J2Oxd7bE1efTrOG241DTYVJByP/SxR9jl1t7iZqYxDX864jgBQ==
rimraf@2, rimraf@^2.5.2, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.3:
version "2.7.1"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"