Skip to content

Commit

Permalink
Merge pull request #10 from ASEIDEL77/bugfix/fix_response_handling
Browse files Browse the repository at this point in the history
Update example.js to be more resilient wrt config response
  • Loading branch information
reggeenr authored Jun 24, 2022
2 parents 7b9be85 + 05a41df commit c4c6f4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ typings/

# Optional npm cache directory
.npm
.npmrc

# Optional eslint cache
.eslintcache
Expand Down
2 changes: 1 addition & 1 deletion example/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit c4c6f4b

Please sign in to comment.