Fix type errors

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-01-10 15:18:11 -05:00
1 parent 58cbf5f300
commit 8761aa1b4a
4 files changed
+26 -7

No files matched your search

+4 -1
View File
@@ -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,
});
+1 -1
View File
@@ -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");
}