@@ -217,8 +217,9 @@ func (r *GatlingReconciler) gatlingRunnerReconcile(ctx context.Context, req ctrl
217
217
err := r .Get (ctx , client.ObjectKey {Name : gatling .Status .RunnerJobName , Namespace : req .Namespace }, foundJob )
218
218
if err != nil && apierr .IsNotFound (err ) {
219
219
duration := utils .GetEpocTime () - gatling .Status .RunnerStartTime
220
- if duration > maxJobCreationWaitTimeInSeconds {
221
- msg := fmt .Sprintf ("Runs out of time (%d sec) in creating the runner job" , maxJobCreationWaitTimeInSeconds )
220
+ maxCreationWaitTIme := int32 (utils .GetNumEnv ("MAX_JOB_CREATION_WAIT_TIME" , maxJobCreationWaitTimeInSeconds ))
221
+ if duration > maxCreationWaitTIme {
222
+ msg := fmt .Sprintf ("Runs out of time (%d sec) in creating the runner job" , maxCreationWaitTIme )
222
223
log .Error (err , msg , "namespace" , req .Namespace , "name" , gatling .Status .RunnerJobName )
223
224
gatling .Status .Error = msg
224
225
if err := r .updateGatlingStatus (ctx , gatling ); err != nil {
@@ -240,8 +241,9 @@ func (r *GatlingReconciler) gatlingRunnerReconcile(ctx context.Context, req ctrl
240
241
241
242
// Check if the job runs out of time in running the job
242
243
duration := utils .GetEpocTime () - gatling .Status .RunnerStartTime
243
- if duration > maxJobRunWaitTimeInSeconds {
244
- msg := fmt .Sprintf ("Runs out of time (%d sec) in running the runner job" , maxJobCreationWaitTimeInSeconds )
244
+ maxRunWaitTIme := int32 (utils .GetNumEnv ("MAX_JOB_RUN_WAIT_TIME" , maxJobRunWaitTimeInSeconds ))
245
+ if duration > maxRunWaitTIme {
246
+ msg := fmt .Sprintf ("Runs out of time (%d sec) in running the runner job" , maxRunWaitTIme )
245
247
log .Error (nil , msg , "namespace" , req .Namespace , "name" , gatling .Status .ReporterJobName )
246
248
gatling .Status .Error = msg
247
249
if err := r .updateGatlingStatus (ctx , gatling ); err != nil {
@@ -317,8 +319,9 @@ func (r *GatlingReconciler) gatlingReporterReconcile(ctx context.Context, req ct
317
319
if err != nil && apierr .IsNotFound (err ) {
318
320
// Check if the job runs out of time in creating the job
319
321
duration := utils .GetEpocTime () - gatling .Status .ReporterStartTime
320
- if duration > maxJobCreationWaitTimeInSeconds {
321
- msg := fmt .Sprintf ("Runs out of time (%d sec) in creating the reporter job" , maxJobCreationWaitTimeInSeconds )
322
+ maxCreationWaitTIme := int32 (utils .GetNumEnv ("MAX_JOB_CREATION_WAIT_TIME" , maxJobCreationWaitTimeInSeconds ))
323
+ if duration > maxCreationWaitTIme {
324
+ msg := fmt .Sprintf ("Runs out of time (%d sec) in creating the reporter job" , maxCreationWaitTIme )
322
325
log .Error (err , msg , "namespace" , req .Namespace , "name" , gatling .Status .ReporterJobName )
323
326
gatling .Status .Error = msg
324
327
if err := r .updateGatlingStatus (ctx , gatling ); err != nil {
@@ -334,8 +337,9 @@ func (r *GatlingReconciler) gatlingReporterReconcile(ctx context.Context, req ct
334
337
}
335
338
// Check if the job runs out of time in running the job
336
339
duration := utils .GetEpocTime () - gatling .Status .ReporterStartTime
337
- if duration > maxJobRunWaitTimeInSeconds {
338
- msg := fmt .Sprintf ("Runs out of time (%d sec) in running the reporter job, and no longer requeue" , maxJobCreationWaitTimeInSeconds )
340
+ maxRunWaitTIme := int32 (utils .GetNumEnv ("MAX_JOB_RUN_WAIT_TIME" , maxJobRunWaitTimeInSeconds ))
341
+ if duration > maxRunWaitTIme {
342
+ msg := fmt .Sprintf ("Runs out of time (%d sec) in running the reporter job, and no longer requeue" , maxRunWaitTIme )
339
343
log .Error (nil , msg , "namespace" , req .Namespace , "name" , gatling .Status .ReporterJobName )
340
344
gatling .Status .Error = msg
341
345
if err := r .updateGatlingStatus (ctx , gatling ); err != nil {
0 commit comments