Repository navigation
Support per-step timeout field in Kptfile pipeline #4814
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
base: main
Are you sure you want to change the base?
Changes from all commits
03c814b
8550705
4894ab2
4e1534c
ba5dc16
0d88a10
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -391,6 +391,12 @@ type Function struct { | |
| // - Check resource count among the selected resources: | ||
| // `when: "resources.filter(r, r.kind == 'Deployment').size() > 0"` | ||
| CelCondition string `yaml:"when,omitempty" json:"when,omitempty"` | ||
|
|
||
| // Timeout specifies the maximum execution time for this function step | ||
| // (e.g. "30s", "1m", "5m"). If omitted, the pipeline timeout or default | ||
| // function timeout (5m) is used. Applicable to container and exec based | ||
| // functions only. | ||
| Timeout string `yaml:"timeout,omitempty" json:"timeout,omitempty"` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would propose using Do we want to maybe have a copy of that |
||
| } | ||
|
|
||
| // ResourceReference identifies a resource within the package by its API identity. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -180,6 +180,11 @@ fn-args: | |
| b) the literal value of `--tag`, if it is not a semantic version constraint. | ||
| See the constraints spec here: https://github.com/Masterminds/semver | ||
|
|
||
| --timeout: | ||
| Maximum time the function is allowed to run, e.g. `30s` or `10m`. | ||
| If the function has not finished by then, the command fails. Default: `5m`. | ||
| Note that this is applicable to container and exec based functions only. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We only have container and exec functions |
||
|
|
||
| --type, t; | ||
| Specify the function type. Accept value `mutator` (default), `validator`. | ||
| If used with `--save`, this flag will save the evaluated function to the corresponding | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,6 +80,15 @@ PKG_PATH: | |
| it doesn't exist. Structured results emitted by the functions are aggregated and saved | ||
| to `results.yaml` file in the specified directory. | ||
| If not specified, no result files are written to the local filesystem. | ||
|
|
||
| --timeout: | ||
| Maximum time the whole pipeline is allowed to run, e.g. `30s` or `10m`. | ||
| This includes the functions of all subpackages. If the pipeline has not | ||
| finished by then, the function that is running is stopped and the render fails. | ||
| When this flag is not set, there is no limit for the whole pipeline, and each | ||
| function is allowed to run for 5 minutes, or for its `timeout` from the | ||
| Kptfile if it sets one. | ||
| Note that this is applicable to container and exec based functions only. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We only have container and exec functions |
||
| ``` | ||
|
|
||
| #### Kptfile Annotations | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only have container and exec functions