Skip to content

Commit c4c6f4b

Browse files
authored
Merge pull request #10 from ASEIDEL77/bugfix/fix_response_handling
Update example.js to be more resilient wrt config response
2 parents 7b9be85 + 05a41df commit c4c6f4b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ typings/
5151

5252
# Optional npm cache directory
5353
.npm
54+
.npmrc
5455

5556
# Optional eslint cache
5657
.eslintcache

example/example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ async function main() {
6464

6565
// Setup Kubernetes client.
6666
const kubeConfig = new k8s.KubeConfig();
67-
kubeConfig.loadFromString(configResponse.result);
67+
kubeConfig.loadFromString(typeof configResponse.result === "string" ? configResponse.result : JSON.stringify(configResponse.result));
6868
const kubeClient = kubeConfig.makeApiClient(k8s.CoreV1Api);
6969
const { namespace } = kubeConfig.getCurrentContextObject();
7070

0 commit comments

Comments
 (0)