Skip to content

Commit

Permalink
Restore timeouts default for v1
Browse files Browse the repository at this point in the history
This commit restores the pipelineRun timeouts default for v1.
  • Loading branch information
JeromeJu committed Mar 7, 2023
1 parent 9c4d457 commit 985560a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/apis/pipeline/v1/pipelinerun_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ func (pr *PipelineRun) SetDefaults(ctx context.Context) {
func (prs *PipelineRunSpec) SetDefaults(ctx context.Context) {
cfg := config.FromContextOrDefaults(ctx)

if prs.Timeouts != nil && prs.Timeouts.Pipeline == nil {
if prs.Timeouts == nil {
prs.Timeouts = &TimeoutFields{}
}

if prs.Timeouts.Pipeline == nil {
prs.Timeouts.Pipeline = &metav1.Duration{Duration: time.Duration(cfg.Defaults.DefaultTimeoutMinutes) * time.Minute}
}

Expand Down

0 comments on commit 985560a

Please sign in to comment.