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

fix we need a path error #77

Merged
merged 1 commit into from Aug 13, 2018
Merged

fix we need a path error #77

merged 1 commit into from Aug 13, 2018

Conversation

ghost
Copy link

@ghost ghost commented Aug 13, 2018

Commit 4ef9254 (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)

Commit 4ef9254 (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)
```
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Aug 13, 2018
@brendandburns
Copy link
Contributor

Ugh, clearly we need better testing sigh

Thanks for the fix.

@brendandburns brendandburns merged commit 24f7c1b into kubernetes-client:master Aug 13, 2018
@brendandburns
Copy link
Contributor

@cmosgh this was pushed as 0.5.2

thanks (and apologies for the break)

@ghost
Copy link
Author

ghost commented Aug 14, 2018

Somehow, the change is not in 0.5.2:

$ curl -s -S https://registry.npmjs.org/@kubernetes/client-node/-/client-node-0.5.2.tgz | tar xzO package/dist/config.js | grep path
const path = require("path");
const jsonpath = require("jsonpath");
                    if (config['cmd-path']) {
                        let cmd = '"' + config['cmd-path'] + '"';
                        let pathKey = config['token-key'];
                        pathKey = '$' + pathKey.slice(1, -1);
                        config['access-token'] = jsonpath.query(resultObj, path);
        const config = path.join(process.env.HOME, '.kube', 'config');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants