From ae9d09494b1036ab73279fded050326742916acf Mon Sep 17 00:00:00 2001 From: msuret <11944422+msuret@users.noreply.github.com> Date: Tue, 21 May 2024 16:10:01 +0200 Subject: [PATCH] frontend: fix `repeatStreamFunc` for `list` requests `errCb` parameter is the 3rd argument of `get` function returned by `singleApiFactory`, whereas it's only the 2nd argument of `list`. This causes `repeatStreamFunc` to misbehave for `list` calls because the error callback index is hardcoded to `2`. Signed-off-by: msuret <11944422+msuret@users.noreply.github.com> --- frontend/src/lib/k8s/apiProxy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/lib/k8s/apiProxy.ts b/frontend/src/lib/k8s/apiProxy.ts index dbdf2d0c0e..d62fccfa7b 100644 --- a/frontend/src/lib/k8s/apiProxy.ts +++ b/frontend/src/lib/k8s/apiProxy.ts @@ -496,7 +496,7 @@ async function repeatStreamFunc( ) { const endpoint = apiEndpoints[endpointIndex]; const fullArgs = [...args]; - let errCbIndex = 2; + let errCbIndex = funcName === 'get' ? 2 : 1; if (endpoint.isNamespaced) { ++errCbIndex; }