Clearn getPodsByOwnerId method

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2021-01-20 10:16:51 +03:00
1 parent e5b25f5f75
commit 209b67e1f1
1 file changed
+1 -7
@@ -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);
});
}