1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Clearn getPodsByOwnerId method

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2021-01-20 10:16:51 +03:00
parent e5b25f5f75
commit 209b67e1f1

View File

@ -32,14 +32,8 @@ export class PodsStore extends KubeObjectStore<Pod> {
}
getPodsByOwnerId(workloadId: string): Pod[] {
if (!workloadId) return [];
return this.items.filter(pod => {
const owners = pod.getOwnerRefs();
if (!owners.length) return;
return owners.find(owner => owner.uid === workloadId);
return pod.getOwnerRefs().find(owner => owner.uid === workloadId);
});
}