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:
parent
0088addc23
commit
6321b10255
@ -24,10 +24,16 @@ const k8sRequestInjectable = getInjectable({
|
|||||||
return async (cluster, path, { timeout = 30_000, ...init } = {}) => {
|
return async (cluster, path, { timeout = 30_000, ...init } = {}) => {
|
||||||
const controller = withTimeout(timeout);
|
const controller = withTimeout(timeout);
|
||||||
|
|
||||||
return lensFetch(`/${cluster.id}${apiKubePrefix}${path}`, {
|
const response = await lensFetch(`/${cluster.id}${apiKubePrefix}${path}`, {
|
||||||
...init,
|
...init,
|
||||||
signal: controller.signal,
|
signal: controller.signal,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (response.status >= 300 || response.status < 200) {
|
||||||
|
throw new Error(`Failed to retrieve ${path}: ${response.statusText}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.json();
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user