Skip to content

Commit

Permalink
fix(tekton): Set a default PipelineRun timeout of 10 days
Browse files Browse the repository at this point in the history
Starting in Tekton Pipelines v0.4.0, the default timeout for
`TaskRun`s of 10 minutes when no timeout is specified is actually
enforced. The only way to specify a timeout for a `TaskRun` is by
setting a timeout on the `PipelineRun`, so until
tektoncd/pipeline#978 and/or
tektoncd/pipeline#979 are addressed, we
should just set a ridiculously high timeout on all `PipelineRun`s.

Signed-off-by: Andrew Bayer <andrew.bayer@gmail.com>
  • Loading branch information
abayer committed Jun 12, 2019
1 parent 65962ff commit 5347338
Show file tree
Hide file tree
Showing 26 changed files with 47 additions and 18 deletions.
2 changes: 2 additions & 0 deletions pkg/cmd/step/create/step_create_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ func TestGenerateTektonCRDs(t *testing.T) {
}

if d := cmp.Diff(tekton_helpers_test.AssertLoadPipelineRun(t, caseDir), crds.PipelineRun()); d != "" {
pry, _ := yaml.Marshal(crds.PipelineRun())
t.Logf("PR: %s", pry)
t.Errorf("Generated PipelineRun did not match expected: %s", d)
}
if d := cmp.Diff(tekton_helpers_test.AssertLoadPipelineStructure(t, caseDir), crds.Structure()); d != "" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-golang-qs-test-master
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-js-test-repo-really-long
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-jx-demo-qs-master
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-js-test-repo-really-long
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-jx-demo-qs-master
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-js-test-repo-really-long
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-golang-qs-test-master
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-js-test-repo-really-long
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-js-test-repo-really-long
serviceAccount: tekton-bot
timeout: 240h0m0s
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-js-test-repo-build-pack
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: jenkins-x-jx-fix-kaniko-special
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-jx-demo-qs-master
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-jx-demo-qs-master
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-js-test-repo-override-de
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-golang-qs-test-master
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-js-test-repo-really-long
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-jx-demo-qs-master
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-golang-qs-test-master
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-golang-qs-test-master
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-js-test-repo-really-long
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-jx-demo-qs-master
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-js-test-repo-really-long
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-jx-demo-qs-master
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
apiVersion: tekton.dev/v1alpha1
name: abayer-js-test-repo-no-default
serviceAccount: tekton-bot
timeout: 240h0m0s
trigger:
type: manual
status: {}
status: {}
2 changes: 2 additions & 0 deletions pkg/tekton/pipelines.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ func CreatePipelineRun(resources []*pipelineapi.PipelineResource,
},
Resources: resourceBindings,
Params: pipelineParams,
// TODO: This should be configurable, and we shouldn't have to set a timeout in the first place. See https://github.com/tektoncd/pipeline/issues/978
Timeout: &metav1.Duration{ Duration: 240 * time.Hour},
},
}

Expand Down

0 comments on commit 5347338

Please sign in to comment.