mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Upgrade js-yaml to 4.X (#3623)
This commit is contained in:
1 parent
fcb3010033
commit
5998b4ca84
17 files changed
+90
-57
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user