Upgrade js-yaml to 4.X (#3623)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-10-18 10:03:10 -04:00
1 parent fcb3010033
commit 5998b4ca84
17 files changed
+90 -57

No files matched your search

+7 -3
View File
@@ -32,9 +32,13 @@ export default {
const cluster = value[1];
if (!cluster.kubeConfig) continue;
const kubeConfig = yaml.safeLoad(cluster.kubeConfig);
const config = yaml.load(cluster.kubeConfig);
if (!kubeConfig.hasOwnProperty("users")) continue;
if (!config || typeof config !== "object" || !config.hasOwnProperty("users")) {
continue;
}
const kubeConfig = config as Record<string, any>;
const userObj = kubeConfig.users[0];
if (userObj) {
@@ -56,7 +60,7 @@ export default {
name: userObj.name,
user
}];
cluster.kubeConfig = yaml.safeDump(kubeConfig);
cluster.kubeConfig = yaml.dump(kubeConfig);
store.set(clusterKey, cluster);
}
}