From 1bdba211338ab1f7c83fe7aa27408b3c5a0d3ee1 Mon Sep 17 00:00:00 2001 From: Clemens Buchacher Date: Mon, 13 Aug 2018 12:55:42 +0200 Subject: [PATCH] fix `we need a path` error Commit 4ef92544 (Add tslint validation.) renames path to pathKey, but misses one usage of the variable. This leads to the following error: ``` AssertionError [ERR_ASSERTION]: we need a path at JSONPath.query (...\node_modules\jsonpath\lib\index.js:92:10) at KubeConfig.applyAuthorizationHeader (...\node_modules\@kubernetes\client-node\dist\config.js:174:59) ``` --- node-client/src/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node-client/src/config.ts b/node-client/src/config.ts index 361ea5675c..0259b01825 100644 --- a/node-client/src/config.ts +++ b/node-client/src/config.ts @@ -228,7 +228,7 @@ export class KubeConfig { // Format in file is {}, so slice it out and add '$' pathKey = '$' + pathKey.slice(1, -1); - config['access-token'] = jsonpath.query(resultObj, path); + config['access-token'] = jsonpath.query(resultObj, pathKey); token = 'Bearer ' + config['access-token']; } else { throw new Error('Token is expired!');