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

TypeError: Cannot read property '0' of undefined #621

Open
SamDecrock opened this issue Apr 30, 2020 · 2 comments
Open

TypeError: Cannot read property '0' of undefined #621

SamDecrock opened this issue Apr 30, 2020 · 2 comments

Comments

@SamDecrock
Copy link

SamDecrock commented Apr 30, 2020

When trying to create a Deployment, Secret or anything but a Namespace from inside a pod with a correct ServiceAccount attached to it, I get the following error:

TypeError: Cannot read property '0' of undefined
    at pathnameParameterNames.reduce (/app/node_modules/swagger-fluent/lib/loader.js:118:35)
    at Array.reduce (<anonymous>)
    at Root.getPathnameParameters (/app/node_modules/swagger-fluent/lib/loader.js:117:35)
    at Root._requestAsync (/app/node_modules/swagger-fluent/lib/loader.js:243:32)
    at Root._post (/app/node_modules/swagger-fluent/lib/loader.js:295:17)
    ...

If I make a ServiceAccount that's bound to a ClusterRole, I'm able to create a Namespace but nothing more.

Here's an example of me trying to create a Deployment:

const Client = require('kubernetes-client').Client
const client = new Client({ version: '1.13' })
var createdObject = await client.apis.apps.v1.namespaces(NAMESPACE_NAME).deployments.post({ body: deployment});

What I'm doing wrong?

Edit: it seems to be related to #620

@SamDecrock
Copy link
Author

Ok, going back to version 8.3.6 resolved the issue

@Flydiverny
Copy link

swagger-fluent 5.0.2 was abit broken and in semver range if you did an npm install between 29th and 30th april.
New version should solve it and kubernetes-client v9 uses swagger fluent ^5.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants