You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This feature allows a Task author to specify a Step timeout in a
Taskrun.
An example use case is when a Task author would like to execute a
Step for setting up an execution environment. One may expect this
Step to execute within a few seconds. If the execution time takes
longer than expected one may rather want to fail fast instead of
waiting for the TaskRun timeout to abort the TaskRun.
Closestektoncd#1690
A `Step` can specify a `timeout` field. If the `Step` execution time exceeds the specified timeout, this `Step` and any subsequent `Steps` are canceled.
248
+
Specifically, the running process spawned by the `Step` is killed.
249
+
An accompanying log is output under the `status.conditions.message` field of the `TaskRun` YAML.
250
+
251
+
The format for a timeout is a duration string as specified in the [Go time package](https://golang.org/pkg/time/#ParseDuration) (e.g. 1s or 1ms).
252
+
253
+
The example `Step` below is supposed to sleep for 60 seconds but will be canceled by the specified 5 second timeout.
254
+
```yaml
255
+
steps:
256
+
- name: sleep-then-timeout
257
+
image: ubuntu
258
+
script: |
259
+
#!/usr/bin/env bash
260
+
echo "I am supposed to sleep for 60 seconds!"
261
+
sleep 60
262
+
timeout: 5s
263
+
```
245
264
### Specifying `Parameters`
246
265
247
266
You can specify parameters, such as compilation flags or artifact names, that you want to supply to the `Task` at execution time.
0 commit comments