Skip to content

Path to ca.pem must be absolute #224

@tetchel

Description

@tetchel
Error: ENOENT: no such file or directory, open 'mycluster/ca.pem'
Logger.js:133
	at Object.fs.openSync (fs.js:577:3)
	at Object.module.(anonymous function) [as openSync] (ELECTRON_ASAR.js:166:20)
	at Object.fs.readFileSync (fs.js:483:33)
	at Object.exports.wrapFsWithAsar.fs.readFileSync (ELECTRON_ASAR.js:563:29)
	at bufferFromFileOrString (/Users/tim/programs/microclimate-vscode/dev/node_modules/@kubernetes/client-node/dist/config.js:280:19)
	at KubeConfig.applyHTTPSOptions (/Users/tim/programs/microclimate-vscode/dev/node_modules/@kubernetes/client-node/dist/config.js:199:38)
	at KubeConfig.applyOptions (/Users/tim/programs/microclimate-vscode/dev/node_modules/@kubernetes/client-node/dist/config.js:234:14)
	at KubeConfig.applyToRequest (/Users/tim/programs/microclimate-vscode/dev/node_modules/@kubernetes/client-node/dist/config.js:77:14)
	at Extensions_v1beta1Api.listIngressForAllNamespaces 
[...]

My cluster config contains

- cluster:
    certificate-authority: mycluster/ca.pem

If I replace that path mycluster/ca.pem with an absolute path (/Users/tim/.kube/mycluster/ca.pem), then it works.
If the path is a relative one, or if the file is not found, perhaps the library could prepend the kube config directory $HOME/.kube/ to the configured path?

FWIW the relative path config worked out-of-the-box with the godaddy kubernetes-client, but I like this library's API and typings much more, so I'd like to switch over!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions