Skip to content

Commit

Permalink
frontend: fix repeatStreamFunc for list requests
Browse files Browse the repository at this point in the history
`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>
  • Loading branch information
msuret committed May 21, 2024
1 parent 17f6e7b commit 4252e9e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/lib/k8s/apiProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ async function repeatStreamFunc(
) {
const endpoint = apiEndpoints[endpointIndex];
const fullArgs = [...args];
let errCbIndex = 2;
let errCbIndex = funcName == 'get' ? 2 : 1;

Check warning on line 499 in frontend/src/lib/k8s/apiProxy.ts

View workflow job for this annotation

GitHub Actions / lint (20.x, ubuntu-22.04)

Expected '===' and instead saw '=='
if (endpoint.isNamespaced) {
++errCbIndex;
}
Expand Down

0 comments on commit 4252e9e

Please sign in to comment.