kubeagent 0.1.26 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/orchestrator.js +12 -7
- package/package.json +1 -1
package/dist/orchestrator.js
CHANGED
|
@@ -97,15 +97,20 @@ export async function handleIssues(issues, config, clusterContext, noInteractive
|
|
|
97
97
|
const kbDir = join(configDir(), "clusters", clusterContext ?? "default");
|
|
98
98
|
const dateStr = new Date().toISOString().slice(0, 10);
|
|
99
99
|
// ── Issues detected ──────────────────────────────────────
|
|
100
|
-
const
|
|
101
|
-
const
|
|
100
|
+
const SEVERITY_RANK = { critical: 0, warning: 1, info: 2 };
|
|
101
|
+
const sortBySeverity = (a, b) => (SEVERITY_RANK[a.severity] ?? 3) - (SEVERITY_RANK[b.severity] ?? 3);
|
|
102
|
+
const sortedIssues = [...issues].sort(sortBySeverity);
|
|
103
|
+
const critCount = sortedIssues.filter((i) => i.severity === "critical").length;
|
|
104
|
+
const warnCount = sortedIssues.filter((i) => i.severity === "warning").length;
|
|
105
|
+
const infoCount = sortedIssues.filter((i) => i.severity === "info").length;
|
|
102
106
|
const parts = [
|
|
103
|
-
critCount ? chalk.red(`${critCount}
|
|
104
|
-
warnCount ? chalk.yellow(`${warnCount}
|
|
107
|
+
critCount ? chalk.red(`${critCount} CRITICAL`) : "",
|
|
108
|
+
warnCount ? chalk.yellow(`${warnCount} WARNING`) : "",
|
|
109
|
+
infoCount ? chalk.cyan(`${infoCount} INFO`) : "",
|
|
105
110
|
].filter(Boolean).join(chalk.dim(", "));
|
|
106
|
-
sectionHeader(`${
|
|
107
|
-
const gaveUpIssues =
|
|
108
|
-
const actionableIssues =
|
|
111
|
+
sectionHeader(`${sortedIssues.length} issue${sortedIssues.length !== 1 ? "s" : ""} detected ${parts}`, chalk.red.bold);
|
|
112
|
+
const gaveUpIssues = sortedIssues.filter((i) => getOrCreate(issueKey(i)).gaveUp);
|
|
113
|
+
const actionableIssues = sortedIssues.filter((i) => !getOrCreate(issueKey(i)).gaveUp);
|
|
109
114
|
for (const issue of actionableIssues) {
|
|
110
115
|
printIssue(issue);
|
|
111
116
|
}
|