diff --git a/.gitignore b/.gitignore index a7556fd..b3aca2f 100644 --- a/.gitignore +++ b/.gitignore @@ -51,6 +51,7 @@ typings/ # Optional npm cache directory .npm +.npmrc # Optional eslint cache .eslintcache diff --git a/example/example.js b/example/example.js index 9b63b72..91509a8 100644 --- a/example/example.js +++ b/example/example.js @@ -64,7 +64,7 @@ async function main() { // Setup Kubernetes client. const kubeConfig = new k8s.KubeConfig(); - kubeConfig.loadFromString(configResponse.result); + kubeConfig.loadFromString(typeof configResponse.result === "string" ? configResponse.result : JSON.stringify(configResponse.result)); const kubeClient = kubeConfig.makeApiClient(k8s.CoreV1Api); const { namespace } = kubeConfig.getCurrentContextObject();