mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix type errors from new asyncComputed
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
1eaf253205
commit
03322e69d9
@ -13,10 +13,12 @@ const namespaceMetricsInjectable = getInjectable({
|
||||
instantiate: (di, namespace) => {
|
||||
const requestPodMetricsInNamespace = di.inject(requestPodMetricsInNamespaceInjectable);
|
||||
|
||||
return asyncComputed(async () => {
|
||||
now(60 * 1000); // Update every minute
|
||||
return asyncComputed({
|
||||
getValueFromObservedPromise: async () => {
|
||||
now(60 * 1000); // Update every minute
|
||||
|
||||
return requestPodMetricsInNamespace(namespace.getName());
|
||||
return requestPodMetricsInNamespace(namespace.getName());
|
||||
},
|
||||
});
|
||||
},
|
||||
lifecycle: lifecycleEnum.keyedSingleton({
|
||||
|
||||
@ -13,10 +13,12 @@ const ingressMetricsInjectable = getInjectable({
|
||||
instantiate: (di, ingress) => {
|
||||
const requestIngressMetrics = di.inject(requestIngressMetricsInjectable);
|
||||
|
||||
return asyncComputed(async () => {
|
||||
now(60 * 1000); // Update every minute
|
||||
return asyncComputed({
|
||||
getValueFromObservedPromise: async () => {
|
||||
now(60 * 1000); // Update every minute
|
||||
|
||||
return requestIngressMetrics(ingress.getName(), ingress.getNs());
|
||||
return requestIngressMetrics(ingress.getName(), ingress.getNs());
|
||||
},
|
||||
});
|
||||
},
|
||||
lifecycle: lifecycleEnum.keyedSingleton({
|
||||
|
||||
@ -13,10 +13,12 @@ const nodeMetricsInjectable = getInjectable({
|
||||
instantiate: (di, node) => {
|
||||
const requestClusterMetricsByNodeNames = di.inject(requestClusterMetricsByNodeNamesInjectable);
|
||||
|
||||
return asyncComputed(() => {
|
||||
now(60 * 1000);
|
||||
return asyncComputed({
|
||||
getValueFromObservedPromise: () => {
|
||||
now(60 * 1000);
|
||||
|
||||
return requestClusterMetricsByNodeNames([node.getName()]);
|
||||
return requestClusterMetricsByNodeNames([node.getName()]);
|
||||
},
|
||||
});
|
||||
},
|
||||
lifecycle: lifecycleEnum.keyedSingleton({
|
||||
|
||||
@ -13,10 +13,12 @@ const persistentVolumeClaimMetricsInjectable = getInjectable({
|
||||
instantiate: (di, persistentVolumeClaim) => {
|
||||
const requestPersistentVolumeClaimMetrics = di.inject(requestPersistentVolumeClaimMetricsInjectable);
|
||||
|
||||
return asyncComputed(() => {
|
||||
now(60 * 1000); // update every minute
|
||||
return asyncComputed({
|
||||
getValueFromObservedPromise: () => {
|
||||
now(60 * 1000); // update every minute
|
||||
|
||||
return requestPersistentVolumeClaimMetrics(persistentVolumeClaim);
|
||||
return requestPersistentVolumeClaimMetrics(persistentVolumeClaim);
|
||||
},
|
||||
});
|
||||
},
|
||||
lifecycle: lifecycleEnum.keyedSingleton({
|
||||
|
||||
@ -13,10 +13,12 @@ const daemonSetMetricsInjectable = getInjectable({
|
||||
instantiate: (di, daemonSet) => {
|
||||
const requestPodMetricsForDaemonSets = di.inject(requestPodMetricsForDaemonSetsInjectable);
|
||||
|
||||
return asyncComputed(() => {
|
||||
now(60 * 1000); // update every minute
|
||||
return asyncComputed({
|
||||
getValueFromObservedPromise: () => {
|
||||
now(60 * 1000); // update every minute
|
||||
|
||||
return requestPodMetricsForDaemonSets([daemonSet], daemonSet.getNs());
|
||||
return requestPodMetricsForDaemonSets([daemonSet], daemonSet.getNs());
|
||||
},
|
||||
});
|
||||
},
|
||||
lifecycle: lifecycleEnum.keyedSingleton({
|
||||
|
||||
@ -13,10 +13,12 @@ const deploymentMetricsInjectable = getInjectable({
|
||||
instantiate: (di, deployment) => {
|
||||
const requestPodMetricsForDeployments = di.inject(requestPodMetricsForDeploymentsInjectable);
|
||||
|
||||
return asyncComputed(() => {
|
||||
now(60 * 1000);
|
||||
return asyncComputed({
|
||||
getValueFromObservedPromise: () => {
|
||||
now(60 * 1000);
|
||||
|
||||
return requestPodMetricsForDeployments([deployment], deployment.getNs());
|
||||
return requestPodMetricsForDeployments([deployment], deployment.getNs());
|
||||
},
|
||||
});
|
||||
},
|
||||
lifecycle: lifecycleEnum.keyedSingleton({
|
||||
|
||||
@ -13,10 +13,12 @@ const jobMetricsInjectable = getInjectable({
|
||||
instantiate: (di, job) => {
|
||||
const requestPodMetricsForJobs = di.inject(requestPodMetricsForJobsInjectable);
|
||||
|
||||
return asyncComputed(() => {
|
||||
now(60 * 1000);
|
||||
return asyncComputed({
|
||||
getValueFromObservedPromise: () => {
|
||||
now(60 * 1000);
|
||||
|
||||
return requestPodMetricsForJobs([job], job.getNs());
|
||||
return requestPodMetricsForJobs([job], job.getNs());
|
||||
},
|
||||
});
|
||||
},
|
||||
lifecycle: lifecycleEnum.keyedSingleton({
|
||||
|
||||
@ -13,10 +13,12 @@ const podContainerMetricsInjectable = getInjectable({
|
||||
instantiate: (di, pod) => {
|
||||
const requestPodMetrics = di.inject(requestPodMetricsInjectable);
|
||||
|
||||
return asyncComputed(() => {
|
||||
now(60 * 1000);
|
||||
return asyncComputed({
|
||||
getValueFromObservedPromise: () => {
|
||||
now(60 * 1000);
|
||||
|
||||
return requestPodMetrics([pod], pod.getNs(), "container, namespace");
|
||||
return requestPodMetrics([pod], pod.getNs(), "container, namespace");
|
||||
},
|
||||
});
|
||||
},
|
||||
lifecycle: lifecycleEnum.keyedSingleton({
|
||||
|
||||
@ -13,10 +13,12 @@ const podMetricsInjectable = getInjectable({
|
||||
instantiate: (di, pod) => {
|
||||
const requestPodMetrics = di.inject(requestPodMetricsInjectable);
|
||||
|
||||
return asyncComputed(() => {
|
||||
now(60 * 1000);
|
||||
return asyncComputed({
|
||||
getValueFromObservedPromise: () => {
|
||||
now(60 * 1000);
|
||||
|
||||
return requestPodMetrics([pod], pod.getNs());
|
||||
return requestPodMetrics([pod], pod.getNs());
|
||||
},
|
||||
});
|
||||
},
|
||||
lifecycle: lifecycleEnum.keyedSingleton({
|
||||
|
||||
@ -13,10 +13,12 @@ const replicaSetMetricsInjectable = getInjectable({
|
||||
instantiate: (di, replicaSet) => {
|
||||
const requestPodMetricsForReplicaSets = di.inject(requestPodMetricsForReplicaSetsInjectable);
|
||||
|
||||
return asyncComputed(() => {
|
||||
now(60 * 1000); // update every minute
|
||||
return asyncComputed({
|
||||
getValueFromObservedPromise: async () => {
|
||||
now(60 * 1000); // update every minute
|
||||
|
||||
return requestPodMetricsForReplicaSets([replicaSet], replicaSet.getNs());
|
||||
return requestPodMetricsForReplicaSets([replicaSet], replicaSet.getNs());
|
||||
},
|
||||
});
|
||||
},
|
||||
lifecycle: lifecycleEnum.keyedSingleton({
|
||||
|
||||
@ -13,10 +13,12 @@ const statefulSetMetricsInjectable = getInjectable({
|
||||
instantiate: (di, statefulSet) => {
|
||||
const requestPodMetricsForStatefulSets = di.inject(requestPodMetricsForStatefulSetsInjectable);
|
||||
|
||||
return asyncComputed(() => {
|
||||
now(60 * 1000);
|
||||
return asyncComputed({
|
||||
getValueFromObservedPromise: async () => {
|
||||
now(60 * 1000);
|
||||
|
||||
return requestPodMetricsForStatefulSets([statefulSet], statefulSet.getNs());
|
||||
return requestPodMetricsForStatefulSets([statefulSet], statefulSet.getNs());
|
||||
},
|
||||
});
|
||||
},
|
||||
lifecycle: lifecycleEnum.keyedSingleton({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user