Skip to content

Commit

Permalink
feat(kubekit-client): bump version and enhance error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kahirokunn committed Jun 21, 2024
1 parent 0218495 commit 850c0ed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/kubekit-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kubekit/client",
"version": "0.2.18",
"version": "0.2.19",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"author": "kahirokunn",
Expand Down
6 changes: 5 additions & 1 deletion packages/kubekit-client/src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Agent } from 'undici';
import { ReadableStream, TransformStream } from 'node:stream/web';
import { type ObjectReference } from '../lib/types';
import { KubeConfig } from '../lib/config';
import { KubernetesError, isKubernetesError } from '../lib/error';
import { KubernetesError, isKubernetesError, isTooLargeResourceVersion } from '../lib/error';
export { sleep } from '../lib/sleep';
export { TaskManager } from '../lib/task_manager';

Expand Down Expand Up @@ -148,6 +148,10 @@ export const defaultRetryCondition: RetryConditionFunction = ({ ...object }) =>
return false;
}

if (isKubernetesError(error) && isTooLargeResourceVersion(error)) {
return false;
}

if (typeof error === 'object' && error !== null) {
const isAbortError = Boolean('name' in error && error.name === 'AbortError');

Expand Down

0 comments on commit 850c0ed

Please sign in to comment.