Skip to content

Commit a784713

Browse files
Merge pull request #24 from cjlarose/fix-yaml-types
Update use of js-yaml for compatibility with newer type defintions
2 parents fd3c72b + 947fe92 commit a784713

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

node-client/src/config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ export class KubeConfig {
165165

166166
public loadFromString(config: string) {
167167
var obj = yaml.safeLoad(config);
168-
if (obj.apiVersion != 'v1') {
169-
throw new TypeError('unknown version: ' + obj.apiVersion);
168+
if (obj['apiVersion'] != 'v1') {
169+
throw new TypeError('unknown version: ' + obj['apiVersion']);
170170
}
171-
this.clusters = newClusters(obj.clusters);
172-
this.contexts = newContexts(obj.contexts);
173-
this.users = newUsers(obj.users);
171+
this.clusters = newClusters(obj['clusters']);
172+
this.contexts = newContexts(obj['contexts']);
173+
this.users = newUsers(obj['users']);
174174
this.currentContext = obj['current-context'];
175175
}
176176
}

0 commit comments

Comments
 (0)