-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
TEP-0040 implementation - specifying onError
in a step
#4106
Conversation
The following is the coverage report on the affected files.
|
0f3c355
to
ad79fa7
Compare
The following is the coverage report on the affected files.
|
ad79fa7
to
073b516
Compare
The following is the coverage report on the affected files.
|
073b516
to
c56c41e
Compare
The following is the coverage report on the affected files.
|
c56c41e
to
eeafbd8
Compare
The following is the coverage report on the affected files.
|
eeafbd8
to
cecf3d4
Compare
The following is the coverage report on the affected files.
|
cecf3d4
to
8f8b798
Compare
The following is the coverage report on the affected files.
|
cmd/entrypoint/main.go
Outdated
stepPath = flag.String("step_path", "", "Relative step path, creates the specified path under /tekton/steps/ which "+ | ||
"can be used to store the step metadata e.g. <step-name> in /tekton/steps/<step-name>/") | ||
stepPathLink = flag.String("step_path_link", "", "Relative step path, creates a symbolic link to the "+ | ||
"specified step path e.g. <step-index> in /tekton/steps/<step-index>") |
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.
Three optional flags here introduced here:
onError
- this flag is initialized to eithercontinue
orfail
based on the step definitionstepPath
- the relative path specified in this flag is created under /tekton/steps/stepPathLink
- the relative path specified in this flag is created as a symbolic link tostepPath
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.
What's the reasoning about stepPath
and stepPathLink
? (aka are they required for this feature, if yes, how/why?)
} | ||
// log and exit only if a step error must cause run failure | ||
if e.OnError != entrypoint.ContinueOnError { | ||
log.Fatalf("Error executing command (ExitError): %v", err) |
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.
Checking if onError
is set to continue
to allow a step error. By default, the entrypoint considers a container exiting with non-zero as error and hence not included any special logic for onError
set to fail
. We can change this logic if needed.
cmd/entrypoint/post_writer.go
Outdated
@@ -20,3 +20,41 @@ func (*realPostWriter) Write(file string) { | |||
log.Fatalf("Creating %q: %v", file, err) | |||
} | |||
} | |||
|
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.
Two more functions are introduced (1) to create a file and write the specified content in the file (2) to create a directory and a symbolic link.
e.WritePostFile(e.PostFile, nil) | ||
e.WriteExitCodeFile(e.StepPathLink, "0") | ||
default: | ||
// for a step without continue on error and any error, write a post file with .err |
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.
creating an InternalTektonResultType
with a failed exit code similar to StartedAt
time which is then read while updating the pod status.
The changes are ready for review, I will add more unit tests if we agree with the overall implementation 🙏 Appreciate your comments 🥺 |
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.
Few question, more on design than on code (things I kinda missed during the TEP, that's fine though 😛)
cmd/entrypoint/main.go
Outdated
stepPath = flag.String("step_path", "", "Relative step path, creates the specified path under /tekton/steps/ which "+ | ||
"can be used to store the step metadata e.g. <step-name> in /tekton/steps/<step-name>/") | ||
stepPathLink = flag.String("step_path_link", "", "Relative step path, creates a symbolic link to the "+ | ||
"specified step path e.g. <step-index> in /tekton/steps/<step-index>") |
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.
What's the reasoning about stepPath
and stepPathLink
? (aka are they required for this feature, if yes, how/why?)
steps: | ||
- image: docker.io/library/golang:latest | ||
name: ignore-unit-test-failure | ||
onError: continue |
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.
Just realizing now that… we could use onError
with the debug feature too, like onError: debug
😅
docs/tasks.md
Outdated
#### Accessing Step's `exitCode` in subsequent `Steps` | ||
|
||
A step can access the exit code of any previous step using the `path` similar to a task result, for example: | ||
|
||
```shell | ||
$(steps.step-<step-name>.exitCode.path) | ||
``` | ||
|
||
The `exitCode` of a step without any name can be referenced using: | ||
|
||
```shell | ||
$(steps.step-unnamed-<step-index>.exitCode.path) | ||
``` | ||
|
||
If you would like to use the tekton internal path, you can access the exit code by reading the file | ||
(which is not recommended though since the path might change in the future): | ||
|
||
```shell | ||
cat /tekton/steps/step-<step-name>/exitCode | ||
``` | ||
|
||
And, access the step exit code without a step name: | ||
|
||
```shell | ||
cat /tekton/steps/step-unnamed-<step-index>/exitCode | ||
``` |
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.
This feels a little bit weird to me, as for example, the index
for unnamed might appear confusing : step-unnamed-2 is the 2nd unnamed step or the 2nd step (and thus the first unnamed) ?
Maybe we could have /tekton/steps/by-index/<index>/…
and /tekton/steps/by-name/<name>/…
(and use link or copy there) ?
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.
This feels a little bit weird to me, as for example, the
index
for unnamed might appear confusing : step-unnamed-2 is the 2nd unnamed step or the 2nd step (and thus the first unnamed) ?
This is designed to match how the containers are named. step-unnamed-2
is the third step (and the first unnamed).
The containers are named step-<name of the step>
if the step has a name else they are named step-unnamed-<step-index>
where <step-index>
is the index of the step in the entire list of the steps.
kubectl get tr test-taskrun-4m59w -o json | jq .status.steps | jq '.[] | .container'
"step-step0"
"step-unnamed-1"
"step-step2"
Maybe we could have
/tekton/steps/by-index/<index>/…
and/tekton/steps/by-name/<name>/…
(and use link or copy there)?
Let me know if it still sounds confusing, we can make it better.
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.
Ok this is less confusing I think (especially if it follows the same).
I still think having that /tekton/steps/by-index/…
and …/by-name/…
would make sense 😛 (I may be biased by linux, but I am a fan of this type of construct in the /dev
virtual fs)
pkg/entrypoint/entrypointer.go
Outdated
// create a step path pipeline.StepPath/step-<step-name>/ if a step name is specified | ||
// or pipeline.StepPath/step-unnamed-<step-index>/ if a step name is missing | ||
// Create a symlink: | ||
// ln -s pipeline.StepPath/<step-index> pipeline.StepPath/<step-name> | ||
e.PostWriter.CreatePath(e.StepPath, e.StepPathLink) | ||
|
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.
For the future, I think we should write in /tekton/steps/by-index/<index>/…
and then link to elsewhere (either by name, or to keep backward compat, …)
pkg/pod/entrypoint.go
Outdated
@@ -25,6 +25,8 @@ import ( | |||
"path/filepath" | |||
"strings" | |||
|
|||
"github.com/tektoncd/pipeline/pkg/apis/pipeline" | |||
|
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.
nit: extra empty line 😝
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.
Looks great, I left a bunch of nitty code / style comments but it looks pretty close to me!
cmd/entrypoint/post_writer.go
Outdated
} | ||
} | ||
|
||
// CreatePath creates the specified path and a symbolic link to the path |
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.
Suggest CreateDirWithSymlink
or similar as the func name. CreatePath
is nice and concise but the expected behaviour is much more specific than the name implies I think?
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.
thanks @sbwsg for the suggestion, have renamed it to CreateDirWithSymlink
👍
cmd/entrypoint/post_writer.go
Outdated
return | ||
} | ||
if err := os.MkdirAll(source, 0770); err != nil { | ||
log.Fatalf("Creating file path %q: %v", source, err) |
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.
tiny nit: suggest Creating directory %q: %v
since it's MkdirAll
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.
Done ✅
@@ -142,6 +142,8 @@ of how this directory is used: | |||
* These folders are [part of the Tekton API](../api_compatibility_policy.md): | |||
* `/tekton/results` is where [results](#results) are written to | |||
(path available to `Task` authors via [`$(results.name.path)`](../variables.md)) | |||
* `/tekton/steps` is where the `step` exitCodes are written to |
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.
This is great. Would also love to see a section in this doc talking a bit more in-depth about the implementation details of step exit codes / onerror if possible? e.g. purpose of both the directory & the symlink, how the exitcode is shared between steps, etc...
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.
I have added two sections in the end of the README.
- What and Why of
/tekton/steps
- https://github.com/tektoncd/pipeline/pull/4106/files#diff-fb2c200965217efdd737c2d18433086a2a6cd879a5b0213fe8253cb14546be6fR472 - How to access the exit code of a step from any subsequent step in a task - https://github.com/tektoncd/pipeline/pull/4106/files#diff-fb2c200965217efdd737c2d18433086a2a6cd879a5b0213fe8253cb14546be6fR601
docs/tasks.md
Outdated
A step can access the exit code of any previous step using the `path` similar to a task result, for example: | ||
|
||
```shell | ||
$(steps.step-<step-name>.exitCode.path) |
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.
Here the exit code is inside the file pointed to by path
, is that right? So to read the exit code you need to cat $(steps.step-X.exitCode.path)
? Could the line before this read something more like, A step can access the exit code of any previous step by reading the file pointed to by the exitCode path variable:
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.
thanks, yup, reworded and makes more sense now 🤣
pkg/entrypoint/entrypointer.go
Outdated
OnError string | ||
// StepPath is the path to that step directory where any step related metadata can be stored | ||
StepPath string | ||
// StepPathLink is the path which needs to be linked to the StepPath |
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.
Would be useful to explain the intended purpose of the symlink too I think. Without the context it's a bit tricky to understand why it would be useful.
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.
added a bit of doc here and also explanation in the developers doc - https://github.com/tektoncd/pipeline/pull/4106/files#diff-fb2c200965217efdd737c2d18433086a2a6cd879a5b0213fe8253cb14546be6fR593
pkg/entrypoint/entrypointer.go
Outdated
// create a step path pipeline.StepPath/step-<step-name>/ if a step name is specified | ||
// or pipeline.StepPath/step-unnamed-<step-index>/ if a step name is missing | ||
// Create a symlink: | ||
// ln -s pipeline.StepPath/<step-index> pipeline.StepPath/<step-name> |
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.
If we rename the method from CreatePath
to CreateDirAndSymlink
(or similar) I expect this comment could explain the purpose of creation rather than the mechanics. E.g. could read something like, // Create the directory where we will store the exit codes (and eventually other metadata) of Steps.
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.
yup make sense, done ✅
pkg/entrypoint/entrypointer.go
Outdated
// set it to "fail" to indicate the entrypoint to exit the taskRun if the container exits with non zero exit code | ||
// set it to "continue" to indicate the entrypoint to continue executing the rest of the steps irrespective of the container exit code | ||
OnError string | ||
// StepPath is the path to that step directory where any step related metadata can be stored |
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.
Nit: suggest StepDirectory
or StepDir
just to be super explicit. Also suggest for StepDirLink
or similar.
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.
renamed it to StepMetadataDir
to match the following suggestion 👍
cmd/entrypoint/main.go
Outdated
"Set to \"fail\" to declare a failure with a step error and stop executing the rest of the steps.") | ||
stepPath = flag.String("step_path", "", "Relative step path, creates the specified path under /tekton/steps/ which "+ | ||
"can be used to store the step metadata e.g. <step-name> in /tekton/steps/<step-name>/") | ||
stepPathLink = flag.String("step_path_link", "", "Relative step path, creates a symbolic link to the "+ |
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.
nit: suggest step_dir
and step_dir_link
(or maybe even step_metadata_dir
? too much?) just to be super explicit about usage. Mirrors the explicitness of wait_file
/ post_file
(though not termination_path
😭 )
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.
yup, no harm in being a little more verbose, renamed to step_metadata_dir
and step_metadata_dir_link
cmd/entrypoint/main.go
Outdated
stepPath = flag.String("step_path", "", "Relative step path, creates the specified path under /tekton/steps/ which "+ | ||
"can be used to store the step metadata e.g. <step-name> in /tekton/steps/<step-name>/") | ||
stepPathLink = flag.String("step_path_link", "", "Relative step path, creates a symbolic link to the "+ | ||
"specified step path e.g. <step-index> in /tekton/steps/<step-index>") |
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.
I'm a tad confused about <step-index> in /tekton/steps/<step-index>
. Does the user pass in just <step-index>
or the full /tekton/steps/0
?
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.
yup the user pass in just the <step-index>
, added an explanation in the developers doc - https://github.com/tektoncd/pipeline/pull/4106/files#diff-fb2c200965217efdd737c2d18433086a2a6cd879a5b0213fe8253cb14546be6fR590
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.
Ah, we might have a slight mismatch to tackle here. In the new unit tests we're passing the absolute paths over to the entrypoint from the pod package.
I think passing the absolute paths is a fine way to go, I just wanna make sure the arg help text here lines up with that.
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.
Hey @sbwsg I am so sorry to confuse you 😭 it is taking the absolute path similar to the others i.e.
"-wait_file", filepath.Join(mountPoint, fmt.Sprintf("%d", i-1)),
"-post_file", filepath.Join(mountPoint, fmt.Sprintf("%d", i)),
"-termination_path", terminationPath,
"-step_metadata_dir", filepath.Join(pipeline.StepsDir, name),
"-step_metadata_dir_link", filepath.Join(pipeline.StepsDir, fmt.Sprintf("%d", i)),
}
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.
I have updated the doc and this file as well. While implementing I had a relative path in mind but going with how the other flags are implemented, chose to go with absolute path and forgot all about it 😢
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.
Awesome, makes total sense, cheers @pritidesai !
They are required for this feature since this feature implements creating a file |
8f8b798
to
6807c96
Compare
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.
It would be great to introduce a test of some kind that checks how results are treated in the event of failure. I see that the pipelinerun example
includes a result from a step but it would be super useful to have some test code ensuring it's returned as expected. This might be best suited as an alpha integration test?
There are also 2 things which I think might be worth documenting as part of this PR:
- Behavior of Task Results written by Steps that continue on error. (probably as part of
tasks.md
?) - Interaction of this feature with the debug/breakpoint feature. It looks like specifying breakpoint behaviour overrides the
onError
behaviour? (again probably worth capturing intasks.md
?)
Otherwise this lgtm!
@@ -104,6 +120,10 @@ func (e Entrypointer) Go() error { | |||
_ = logger.Sync() | |||
}() | |||
|
|||
// Create the directory where we will store the exit codes (and eventually other metadata) of Steps. | |||
// Create a symlink to the directory for easier access by the index instead of a step name. |
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.
👍 nice, thanks a lot for tackling that.
Hey @pritidesai ! Just a drive by comment, I added a comment to the TEP PR for this (tektoncd/community#463 (comment)), I think there's some behavior worth fleshing out in the TEP - maybe you already dealt with this in the PR and it's just a matter of updating the TEP, or maybe we need to discuss further. |
cdd3389
to
dbed261
Compare
The following is the coverage report on the affected files.
|
dbed261
to
b312e44
Compare
The following is the coverage report on the affected files.
|
b312e44
to
d8d2171
Compare
The following is the coverage report on the affected files.
|
I have added an additonal
Added a section in tasks.md
Yes that is correct, breakpoint overrides the step error functionality and breakpoint feature provides different tools to mark a step as failure/success. Have captured it briefly here
thanks @sbwsg for reviewing the PR |
this commit implements tep-0049 - ignore a step error When a `step` in a `task` results in a failure, the rest of the steps in the `task` are skipped and the `taskRun` is declared a failure. If you would like to ignore such step errors and continue executing the rest of the steps in the task, you can specify `onError` for such a `step`. `onError` can be set to either `continue` or `fail` as part of the step definition. If `onError` is set to `continue`, the entrypoint sets the original failed exit code of the script in the container terminated state. A `step` with `onError` set to `continue` does not fail the `taskRun` and continues executing the rest of the steps in a task. This is an alpha feature. The `enable-api-fields` feature flag must be set to `"alpha"` to specify `onError` for a `step`. This commit includes following changes: * Changing entrypoint to include three new flags `onError`, `stepMetadataDir`, and `stepMetadataDirLink`. * Adding one new function as part of the runner CreateDirWithSymlink * Creating a volume `/tekton/steps/` * Supporting a path variable $(steps.step-<stepName>.exitCode.path) and $(steps.step-unnamed-<stepIndex>.exitCode.path) * API spec `onError` while defining a step * Writing exitCode at /tekton/steps/step-<step-name>/exitCode or /tekton/steps/step-unnamed-<step-index>/exitCode * Set the exitCode of a terminated state to a non-zero exit code * Doc, unit test, and examples for this feature
d8d2171
to
fdeb0b1
Compare
onError
for a step onError
in a step
The following is the coverage report on the affected files.
|
to access the result and run with the resolved value. | ||
|
||
Now, a step can fail before initializing a result and the `pipeline` can ignore such step failure. But, the `pipeline` | ||
will fail with `InvalidTaskResultReference` if it has a task consuming that task result. For example, any task |
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.
Oh wow, I hadn't even considered this case. Good point!
/lgtm |
Pipeline 0.27 was released in August 2021 which introduced an alpha feature to specify onError in a step. This feature was implemented in the PR tektoncd#4106: tektoncd#4106 To enable this feature, the Tekton Pipeline deployment had to set enable-api-fields to alpha. After discussing this in the API WG: https://docs.google.com/document/d/17PodAxG8hV351fBhSu7Y_OIPhGTVgj6OJ2lPphYYRpU/edit#heading=h.ig94pf1w10xc We have sent an email out to collect the feedback from the users. @skaegi is looking forward to this promotion. This commit is updating task validation to no longer require enable-api-fields is set to alpha. The documentation is updated to moved it out of the alpha section. The example yamls moved out of alpha.
Pipeline 0.27 was released in August 2021 which introduced an alpha feature to specify onError in a step. This feature was implemented in the PR tektoncd#4106: tektoncd#4106 To enable this feature, the Tekton Pipeline deployment had to set enable-api-fields to alpha. After discussing this in the API WG: https://docs.google.com/document/d/17PodAxG8hV351fBhSu7Y_OIPhGTVgj6OJ2lPphYYRpU/edit#heading=h.ig94pf1w10xc We have sent an email out to collect the feedback from the users. @skaegi is looking forward to this promotion. This commit is updating task validation to no longer require enable-api-fields is set to alpha. The documentation is updated to moved it out of the alpha section. The example yamls moved out of alpha. Updated e2e to not include alpha flag.
Pipeline 0.27 was released in August 2021 which introduced an alpha feature to specify onError in a step. This feature was implemented in the PR tektoncd#4106: tektoncd#4106 To enable this feature, the Tekton Pipeline deployment had to set enable-api-fields to alpha. After discussing this in the API WG: https://docs.google.com/document/d/17PodAxG8hV351fBhSu7Y_OIPhGTVgj6OJ2lPphYYRpU/edit#heading=h.ig94pf1w10xc We have sent an email out to collect the feedback from the users. @skaegi is looking forward to this promotion. This commit is updating task validation to no longer require enable-api-fields is set to alpha. The documentation is updated to moved it out of the alpha section. The example yamls moved out of alpha. Updated e2e to not include alpha flag.
Pipeline 0.27 was released in August 2021 which introduced an alpha feature to specify onError in a step. This feature was implemented in the PR tektoncd#4106: tektoncd#4106 To enable this feature, the Tekton Pipeline deployment had to set enable-api-fields to alpha. After discussing this in the API WG: https://docs.google.com/document/d/17PodAxG8hV351fBhSu7Y_OIPhGTVgj6OJ2lPphYYRpU/edit#heading=h.ig94pf1w10xc We have sent an email out to collect the feedback from the users. @skaegi is looking forward to this promotion. This commit is updating task validation to no longer require enable-api-fields is set to alpha. The documentation is updated to moved it out of the alpha section. The example yamls moved out of alpha. Updated e2e to not include alpha flag.
Pipeline 0.27 was released in August 2021 which introduced an alpha feature to specify onError in a step. This feature was implemented in the PR tektoncd#4106: tektoncd#4106 To enable this feature, the Tekton Pipeline deployment had to set enable-api-fields to alpha. After discussing this in the API WG: https://docs.google.com/document/d/17PodAxG8hV351fBhSu7Y_OIPhGTVgj6OJ2lPphYYRpU/edit#heading=h.ig94pf1w10xc We have sent an email out to collect the feedback from the users. @skaegi is looking forward to this promotion. This commit is updating task validation to no longer require enable-api-fields is set to alpha. The documentation is updated to moved it out of the alpha section. The example yamls moved out of alpha. Updated e2e to not include alpha flag.
Changes
This PR implements TEP-0040 - ignore a step error 🛎.
When a
step
in atask
results in a failure, the rest of the steps in thetask
are skipped and thetaskRun
is declared a failure. If you would like to ignore such step errors and continue executing the rest of the steps in the task, you can specifyonError
for such astep
.onError
can be set to eithercontinue
orfail
as part of the step definition. IfonError
is set tocontinue
, the entrypoint sets the original failed exit code of the script in the container terminated state. Astep
withonError
set tocontinue
does not fail thetaskRun
and continues executing the rest of the steps in a task.For example,
The original failed exit code will be part of the run status:
And will be available in a file
/tekton/steps/0/exitCode
.This is an alpha feature. The
enable-api-fields
feature flag must be set to"alpha"
to specifyonError
for astep
.This commit includes following changes:
on_error
,step_metadata_dir
, andstep_metadata_dir_link
./tekton/steps/
.onError
- while defining a step./kind feature
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
Release Notes