1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Fix test failures

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2022-11-24 10:18:04 -05:00
parent 0088addc23
commit 6321b10255

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();
};
},
});