Skip to content

Commit

Permalink
fix: retry request for errors with 'provision' request (#955)
Browse files Browse the repository at this point in the history
Signed-off-by: David Kwon <dakwon@redhat.com>
  • Loading branch information
dkwon17 authored Oct 19, 2023
1 parent f799e06 commit 5f0a611
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('Kubernetes namespace API', () => {
await provisionKubernetesNamespace();

expect(mockGet).not.toBeCalled();
expect(mockPost).toBeCalledWith('/api/kubernetes/namespace/provision');
expect(mockPost).toBeCalledWith('/api/kubernetes/namespace/provision', undefined, undefined);
});

it('should return a list of namespaces', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
* Red Hat, Inc. - initial API and implementation
*/

import axios from 'axios';

import { AxiosWrapper } from '@/services/backend-client/axiosWrapper';
import { cheServerPrefix } from '@/services/backend-client/const';

Expand All @@ -24,7 +22,9 @@ export async function getKubernetesNamespace(): Promise<che.KubernetesNamespace[
}

export async function provisionKubernetesNamespace(): Promise<che.KubernetesNamespace> {
const response = await axios.post(`${cheServerPrefix}/kubernetes/namespace/provision`);
const response = await AxiosWrapper.createToRetryAnyErrors().post(
`${cheServerPrefix}/kubernetes/namespace/provision`,
);

return response.data;
}

0 comments on commit 5f0a611

Please sign in to comment.