@@ -77,10 +77,10 @@ func (t *V2Spec) ScheduledWorkflow(modelJob *model.Job) (*scheduledworkflow.Sche
77
77
}
78
78
}
79
79
80
- var pipeline_options argocompiler.Options
80
+ var PipelineOptions argocompiler.Options
81
81
for _ , platform := range t .platformSpec .Platforms {
82
82
if platform .PipelineConfig .PipelineTtl != 0 {
83
- pipeline_options = argocompiler.Options {
83
+ PipelineOptions = argocompiler.Options {
84
84
TtlSeconds : platform .PipelineConfig .PipelineTtl ,
85
85
}
86
86
break
@@ -89,7 +89,7 @@ func (t *V2Spec) ScheduledWorkflow(modelJob *model.Job) (*scheduledworkflow.Sche
89
89
90
90
var obj interface {}
91
91
if util .CurrentExecutionType () == util .ArgoWorkflow {
92
- obj , err = argocompiler .Compile (job , kubernetesSpec , & pipeline_options )
92
+ obj , err = argocompiler .Compile (job , kubernetesSpec , & PipelineOptions )
93
93
} else if util .CurrentExecutionType () == util .TektonPipelineRun {
94
94
obj , err = tektoncompiler .Compile (job , kubernetesSpec , & tektoncompiler.Options {LauncherImage : Launcher })
95
95
}
@@ -310,19 +310,21 @@ func (t *V2Spec) RunWorkflow(modelRun *model.Run, options RunWorkflowOptions) (u
310
310
}
311
311
}
312
312
313
- var pipeline_options * argocompiler.Options
314
- for _ , platform := range t .platformSpec .Platforms {
315
- if platform .PipelineConfig .PipelineTtl != 0 {
316
- pipeline_options = & argocompiler.Options {
317
- TtlSeconds : platform .PipelineConfig .PipelineTtl ,
313
+ var PipelineOptions * argocompiler.Options
314
+ if t .platformSpec != nil && t .platformSpec .Platforms != nil {
315
+ for _ , platform := range t .platformSpec .Platforms {
316
+ if platform .PipelineConfig .PipelineTtl != 0 {
317
+ PipelineOptions = & argocompiler.Options {
318
+ TtlSeconds : platform .PipelineConfig .PipelineTtl ,
319
+ }
320
+ break
318
321
}
319
- break
320
322
}
321
323
}
322
324
323
325
var obj interface {}
324
326
if util .CurrentExecutionType () == util .ArgoWorkflow {
325
- obj , err = argocompiler .Compile (job , kubernetesSpec , pipeline_options )
327
+ obj , err = argocompiler .Compile (job , kubernetesSpec , PipelineOptions )
326
328
} else if util .CurrentExecutionType () == util .TektonPipelineRun {
327
329
obj , err = tektoncompiler .Compile (job , kubernetesSpec , nil )
328
330
}
0 commit comments