mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix missing filter function
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
9ac6f5213b
commit
01164ed732
@ -84,6 +84,22 @@ export type KubeApiDataFrom<K extends KubeObject, A> = A extends KubeApi<K, infe
|
|||||||
|
|
||||||
export type JsonPatch = Patch;
|
export type JsonPatch = Patch;
|
||||||
|
|
||||||
|
interface ObjectWithLabels {
|
||||||
|
metadata: {
|
||||||
|
labels: Partial<Record<string, string>>;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export const byLabels = (labels: Partial<Record<string, string>>) => (obj: ObjectWithLabels) => {
|
||||||
|
for (const key in labels) {
|
||||||
|
if (obj.metadata.labels[key] !== labels[key]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
export interface KubeObjectStoreDependencies {
|
export interface KubeObjectStoreDependencies {
|
||||||
readonly context: ClusterContext;
|
readonly context: ClusterContext;
|
||||||
readonly logger: Logger;
|
readonly logger: Logger;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user