mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Generic logs view with Pod selector (#1984)
* Adding LogTabStore Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Adding Pod selector in logs tab Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Refresh containers on pod change Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Adding <LogResourceSelector /> tests Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Adding LogTabStore tests Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Clearn getPodsByOwnerId method Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Extracting dummy pods into mock file Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Eliminating containers and initContainers from store Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Refreshing tab pods if pod amount is changed in store Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * A bit of cleaning up, fixing tests Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Fix lint newline errors Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Return getPodsByOwner() method Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Rename log tab when pod changes Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
1 parent
724c6c3265
commit
a157eb03e6
25 files changed
+1359
-135
No files matched your search
@@ -3,8 +3,8 @@ import { action, observable } from "mobx";
|
||||
import { KubeObjectStore } from "../../kube-object.store";
|
||||
import { autobind, cpuUnitsToNumber, unitsToBytes } from "../../utils";
|
||||
import { IPodMetrics, Pod, PodMetrics, podMetricsApi, podsApi } from "../../api/endpoints";
|
||||
import { WorkloadKubeObject } from "../../api/workload-kube-object";
|
||||
import { apiManager } from "../../api/api-manager";
|
||||
import { WorkloadKubeObject } from "../../api/workload-kube-object";
|
||||
|
||||
@autobind()
|
||||
export class PodsStore extends KubeObjectStore<Pod> {
|
||||
@@ -44,6 +44,12 @@ export class PodsStore extends KubeObjectStore<Pod> {
|
||||
});
|
||||
}
|
||||
|
||||
getPodsByOwnerId(workloadId: string): Pod[] {
|
||||
return this.items.filter(pod => {
|
||||
return pod.getOwnerRefs().find(owner => owner.uid === workloadId);
|
||||
});
|
||||
}
|
||||
|
||||
getPodsByNode(node: string) {
|
||||
if (!this.isLoaded) return [];
|
||||
|
||||
|
||||
Reference in new issue
Block a user