Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation about timeout format #1840

Merged
merged 2 commits into from
Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions docs/taskruns.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,22 @@ The `paths` field can be used to [override the paths to a resource](./resources.

### Configuring Default Timeout

You can configure the default timeout by changing the value of `default-timeout-minutes`
in [`config/config-defaults.yaml`](./../config/config-defaults.yaml). The default timeout
is 60 minutes, if `default-timeout-minutes` is not available. There is no timeout by
default, if `default-timeout-minutes` is set to 0.
You can configure the default timeout by changing the value of
`default-timeout-minutes` in
[`config/config-defaults.yaml`](./../config/config-defaults.yaml).

The `timeout` format is a `duration` as validated by Go's
[`ParseDuration`](https://golang.org/pkg/time/#ParseDuration), valid format for
examples are :

- `1h30m`
- `1h`
- `1m`
- `60s`

The default timeout is 60 minutes, if `default-timeout-minutes` is not
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: I find this sentence a bit confusing, maybe because it's about the default value of the default timeout :P

When default-timeout-minutes is not set, default timeout is 60 minutes.
There is no default timeout if default-timeout-minutes is set to 0.

available. There is no timeout by default, if `default-timeout-minutes` is set
to 0.

### Service Account

Expand Down
56 changes: 56 additions & 0 deletions examples/pipelineruns/no-ci/pipeline-timeout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: task-echo-message
spec:
inputs:
params:
- name: MESSAGE
type: string
default: "Hello World"
steps:
- name: echo
image: ubuntu
command:
- sleep 90s
args:
- "$(inputs.params.MESSAGE)"
---

apiVersion: tekton.dev/v1alpha1
kind: PipelineRun
metadata:
name: pipelinerun-timeout
spec:
# 1 hour and half timeout
timeout: 1h30m
pipelineSpec:
params:
- name: MORNING_GREETINGS
description: "morning greetings, default is Good Morning!"
type: string
default: "Good Morning!"
- name: NIGHT_GREETINGS
description: "Night greetings, default is Good Night!"
type: string
default: "Good Night!"
tasks:
# Task to display morning greetings
- name: echo-good-morning
taskRef:
name: task-echo-message
params:
- name: MESSAGE
value: $(params.MORNING_GREETINGS)
# Task to display night greetings
- name: echo-good-night
taskRef:
name: task-echo-message
params:
- name: MESSAGE
value: $(params.NIGHT_GREETINGS)
params:
- name: MORNING_GREETINGS
value: "Good Morning, Bob!"
- name: NIGHT_GREETINGS
value: "Good Night, Bob!"