Fix test failures

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2023-01-10 15:18:12 -05:00
1 parent 0088addc23
commit 6321b10255
1 file changed
+7 -1
+7 -1
View File
@@ -24,10 +24,16 @@ const k8sRequestInjectable = getInjectable({
return async (cluster, path, { timeout = 30_000, ...init } = {}) => {
const controller = withTimeout(timeout);
return lensFetch(`/${cluster.id}${apiKubePrefix}${path}`, {
const response = await lensFetch(`/${cluster.id}${apiKubePrefix}${path}`, {
...init,
signal: controller.signal,
});
if (response.status >= 300 || response.status < 200) {
throw new Error(`Failed to retrieve ${path}: ${response.statusText}`);
}
return response.json();
};
},
});