File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
clients/js/packages/client/src Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export interface StarshipContext {
23
23
verbose ?: boolean ;
24
24
curdir ?: string ;
25
25
timeout ?: string ;
26
+ restartThreshold ?: number ;
26
27
}
27
28
28
29
export const defaultStarshipContext : Partial < StarshipContext > = {
@@ -32,7 +33,8 @@ export const defaultStarshipContext: Partial<StarshipContext> = {
32
33
chart : 'starship/devnet' ,
33
34
namespace : '' ,
34
35
version : '' ,
35
- timeout : '10m'
36
+ timeout : '10m' ,
37
+ restartThreshold : 3
36
38
} ;
37
39
38
40
export interface PodPorts {
@@ -128,9 +130,6 @@ export class StarshipClient implements StarshipClientI {
128
130
129
131
private podStatuses = new Map < string , PodStatus > ( ) ; // To keep track of pod statuses
130
132
131
- // Define a constant for the restart threshold
132
- private readonly RESTART_THRESHOLD = 3 ;
133
-
134
133
constructor ( ctx : StarshipContext ) {
135
134
this . ctx = deepmerge ( defaultStarshipContext , ctx ) ;
136
135
// TODO add semver check against net
@@ -547,9 +546,9 @@ export class StarshipClient implements StarshipClientI {
547
546
reason
548
547
} ) ;
549
548
550
- if ( restarts > this . RESTART_THRESHOLD ) {
549
+ if ( restarts > this . ctx . restartThreshold ) {
551
550
this . log (
552
- `${ chalk . red ( 'Error:' ) } Pod ${ podName } has restarted more than ${ this . RESTART_THRESHOLD } times.`
551
+ `${ chalk . red ( 'Error:' ) } Pod ${ podName } has restarted more than ${ this . ctx . restartThreshold } times.`
553
552
) ;
554
553
this . exit ( 1 ) ;
555
554
}
You can’t perform that action at this time.
0 commit comments