Goyoo / node-k8s-client

kubernetes client of node.js
MIT License
164 stars 59 forks source link

Incorrect implementation for finding cluster from kubeconfig #31

Closed philidem closed 7 years ago

philidem commented 7 years ago

You're currently using:

return kubeconfig.clusters.find(x => x.name === context.name)

Should be:

return kubeconfig.clusters.find(x => x.name === context.context.cluster)

To clarify, the current implementation assumes that the context name will always match the cluster name. The correct method is to read the context.cluster property of the context when searching for cluster.

philidem commented 7 years ago

I'll have a pull request shortly. I just started trying this library and this was the first problem I encountered. I like the low-level simplicity of this so far.

mmoonn2 commented 7 years ago

Thank you for helping to solve this problem