mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix type errors
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
58cbf5f300
commit
8761aa1b4a
4 files changed
+26
-7
No files matched your search
@@ -5,6 +5,7 @@
|
||||
import { getInjectable } from "@ogre-tools/injectable";
|
||||
import FormData from "form-data";
|
||||
import type { Cluster } from "../common/cluster/cluster";
|
||||
import { withTimeout } from "../common/fetch/timeout-controller";
|
||||
import type { RequestMetricsParams } from "../common/k8s-api/endpoints/metrics.api/request-metrics.injectable";
|
||||
import k8sRequestInjectable from "./k8s-request.injectable";
|
||||
|
||||
@@ -29,8 +30,10 @@ const getMetricsInjectable = getInjectable({
|
||||
body.append(key, value);
|
||||
}
|
||||
|
||||
const controller = withTimeout(60 * 1000); // 1 minute timeout
|
||||
|
||||
return k8sRequest(cluster, metricsPath, {
|
||||
timeout: 0,
|
||||
signal: controller.signal,
|
||||
method: "POST",
|
||||
body,
|
||||
});
|
||||
|
||||
@@ -277,7 +277,7 @@ export class Kubectl {
|
||||
|
||||
const response = await this.dependencies.fetch(this.url, { compress: true });
|
||||
|
||||
if (!response.body || !response.body.readable) {
|
||||
if (!response.body || !response.body.readable || response.status !== 200) {
|
||||
throw new Error("Body missing or not readable");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user