Skip to content

Commit 3e0d392

Browse files
committed
Fix watching for pipelinerun timeout
First we define a ridiculous large number for taskrun timeout, so the pac taskrun doesn't timeout before the user defined one. Second we are making sure we are not using the timeout configuration instead of the constant (which was 10minutes by default) Third we are not just warning anymore but actually exit. Signed-off-by: Chmouel Boudjnah <[email protected]>
1 parent f512770 commit 3e0d392

17 files changed

+39
-15
lines changed

config/401-github-issue-recheck.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ spec:
8888
pipelinesascode.tekton.dev/event: $(tt.params.event_type)
8989
spec:
9090
serviceAccountName: pipelines-as-code-sa-el
91+
timeout: 24h0m0s
9192
params:
9293
- name: action
9394
value: $(tt.params.action)

config/402-github-pull-request.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ spec:
8989
app.kubernetes.io/managed-by: pipelines-as-code
9090
pipelinesascode.tekton.dev/event: $(tt.params.event_type)
9191
spec:
92+
timeout: 24h0m0s
9293
serviceAccountName: pipelines-as-code-sa-el
9394
params:
9495
- name: ghe_host

config/403-github-push.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ spec:
8484
app.kubernetes.io/managed-by: pipelines-as-code
8585
pipelinesascode.tekton.dev/event: $(tt.params.event_type)
8686
spec:
87+
timeout: 24h0m0s
8788
serviceAccountName: pipelines-as-code-sa-el
8889
params:
8990
- name: ghe_host

config/404-github-retest-comment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ spec:
7474
app.kubernetes.io/managed-by: pipelines-as-code
7575
pipelinesascode.tekton.dev/event: $(tt.params.event_type)
7676
spec:
77+
timeout: 24h0m0s
7778
serviceAccountName: pipelines-as-code-sa-el
7879
params:
7980
- name: ghe_host

config/422-bitbucket-cloud-pull-request.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ spec:
9797
# pipelinesascode.tekton.dev/event: $(tt.params.event_type)
9898
spec:
9999
serviceAccountName: pipelines-as-code-sa-el
100+
timeout: 24h0m0s
100101
params:
101102
- name: source_ip
102103
value: $(tt.params.source_ip)

config/423-bitbucket-cloud-push.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ spec:
7979
app.kubernetes.io/managed-by: pipelines-as-code
8080
spec:
8181
serviceAccountName: pipelines-as-code-sa-el
82+
timeout: 24h0m0s
8283
params:
8384
- name: source_ip
8485
value: $(tt.params.source_ip)

config/442-bitbucket-server-pull-request.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ spec:
122122
app.kubernetes.io/version: "devel"
123123
app.kubernetes.io/managed-by: pipelines-as-code
124124
spec:
125+
timeout: 24h0m0s
125126
serviceAccountName: pipelines-as-code-sa-el
126127
params:
127128
- name: trigger_target

config/443-bitbucket-server-push.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ spec:
8181
app.kubernetes.io/version: "devel"
8282
app.kubernetes.io/managed-by: pipelines-as-code
8383
spec:
84+
timeout: 24h0m0s
8485
serviceAccountName: pipelines-as-code-sa-el
8586
params:
8687
- name: "event_type"

docs/install.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,18 @@ the `pipelines-as-code` namespace.
468468

469469
<https://api.hub.tekton.dev/v1>
470470

471+
* `default-pipelinerun-timeout`: Default timeout to wait for pipelinerun
472+
(default value is 2 hours).
473+
Note that PaaC doesn't respect the user pipelinerun timeout if it's greater than
474+
this value.
475+
In other words, if you set paac `default-pipelinerun-timeout` to 2h and
476+
your PipelineRun timeout is set to 3h the PipelineRun will timeout after 2h.
477+
If your pipelinerun timeout is set to 1h and your
478+
`default-pipelinerun-timeout` value is 2h, the PipelineRun will timeout after
479+
1h by the tekton controller.
480+
481+
This value cannot exceed 24 hours.
482+
471483
## Kubernetes
472484

473485
Pipelines as Code should work directly on kubernetes/minikube/kind. You just need to install the release.yaml

pkg/kubeinteraction/cleanups.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import (
1414
)
1515

1616
func (k Interaction) CleanupPipelines(ctx context.Context, repo *v1alpha1.Repository, pr *v1beta1.PipelineRun,
17-
maxKeep int) error {
17+
maxKeep int,
18+
) error {
1819
repoLabel := filepath.Join(pipelinesascode.GroupName, "repository")
1920
originalPRLabel := filepath.Join(pipelinesascode.GroupName, "original-prname")
2021
if _, ok := pr.GetLabels()[originalPRLabel]; !ok {

0 commit comments

Comments
 (0)