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

topNodes throws TypeError: "TypeError: Cannot read properties of undefined (reading 'Running')" #1447

Closed
ecksun opened this issue Nov 23, 2023 · 1 comment

Comments

@ecksun
Copy link

ecksun commented Nov 23, 2023

Describe the bug
When using k8s.topNodes an exception is thrown:

/home/user/tmp/k8s-client-node/node_modules/@kubernetes/client-node/dist/top.js:61
        pod.status.phase === 'Running' || pod.status.phase === api_1.V1PodStatus.PhaseEnum.Running);
                                                                                           ^

TypeError: Cannot read properties of undefined (reading 'Running')
    at /home/user/tmp/k8s-client-node/node_modules/@kubernetes/client-node/dist/top.js:61:92
    at Array.filter (<anonymous>)
    at Object.topNodes (/home/user/tmp/k8s-client-node/node_modules/@kubernetes/client-node/dist/top.js:59:21)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async main (/home/user/tmp/k8s-client-node/main.js:9:21)

** Client Version **
e.g. 0.20.0

** Server Version **
e.g. v1.24.9 (also tested in 1.26)

To Reproduce

npm init --yes
npm install @kubernetes/client-node@0.20.0
node <<EOF
const k8s = require('@kubernetes/client-node');

const kc = new k8s.KubeConfig();
kc.loadFromDefault();

const k8sApi = kc.makeApiClient(k8s.CoreV1Api);

const main = async () => {
        console.log(await k8s.topNodes(k8sApi))
};

main();
EOF

Expected behavior

the topNodes promise should resovle and return a list of resources

Environment (please complete the following information):

  • OS: Linux
  • NodeJS Version: v16.17.0

Additional context

The issue was introduced after 0.18.1

@mstruebing
Copy link
Member

mstruebing commented Nov 23, 2023

fixed by #1445

If the issue still persists use the /reopen command.

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