Skip to content

Commit eb66846

Browse files
committed
chore: fix getting pods
1 parent 15cd229 commit eb66846

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/kubernetes.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ export async function getPodStats() {
8080
}
8181

8282
try {
83-
const pods = await apiClient.listPodForAllNamespaces(
83+
const pods = await apiClient.listNamespacedPod(
84+
"5stack",
85+
undefined,
8486
undefined,
8587
undefined,
8688
`spec.nodeName=${nodeName}`,
@@ -90,6 +92,7 @@ export async function getPodStats() {
9092
name: string;
9193
metrics: PodMetric;
9294
}> = [];
95+
9396
for (const pod of pods.body.items) {
9497
if (!pod.metadata?.namespace || !pod.metadata?.name) {
9598
continue;
@@ -99,8 +102,9 @@ export async function getPodStats() {
99102
pod.metadata?.namespace,
100103
pod.metadata?.name,
101104
);
105+
102106
stats.push({
103-
name: pod.metadata?.name,
107+
name: pod.metadata?.labels?.app!,
104108
metrics,
105109
});
106110
} catch (error) {

0 commit comments

Comments
 (0)