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
Copy file name to clipboardexpand all lines: cmd/entrypoint/main.go
+2-1
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,8 @@ var (
54
54
breakpointOnFailure=flag.Bool("breakpoint_on_failure", false, "If specified, expect steps to not skip on failure")
55
55
debugBeforeStep=flag.Bool("debug_before_step", false, "If specified, wait for a debugger to attach before executing the step")
56
56
onError=flag.String("on_error", "", "Set to \"continue\" to ignore an error and continue when a container terminates with a non-zero exit code."+
57
-
" Set to \"stopAndFail\" to declare a failure with a step error and stop executing the rest of the steps.")
57
+
" Set to \"stopAndFail\" to declare a failure with a step error and stop executing the rest of the steps."+
58
+
" Set to \"continueAndFail\" to declare a failure with a step error after having executed the rest of the steps.")
58
59
stepMetadataDir=flag.String("step_metadata_dir", "", "If specified, create directory to store the step metadata e.g. /tekton/steps/<step-name>/")
59
60
resultExtractionMethod=flag.String("result_from", entrypoint.ResultExtractionMethodTerminationMessage, "The method using which to extract results from tasks. Default is using the termination message.")
<td><p>ContinueAndFail indicates continue executing the rest of the steps irrespective of the container exit code and exit after all steps are completed with the first possible non-zero exit code of the step that has this OnErrorType</p>
1757
+
</td>
1755
1758
</tr><tr><td><p>"stopAndFail"</p></td>
1756
1759
<td><p>StopAndFail indicates exit the taskRun if the container exits with non-zero exit code</p>
1757
1760
</td>
@@ -4602,7 +4605,7 @@ OnErrorType
4602
4605
</td>
4603
4606
<td>
4604
4607
<p>OnError defines the exiting behavior of a container on error
4605
-
can be set to [ continue | stopAndFail ]</p>
4608
+
can be set to [ continue | stopAndFail | continueAndFail ]</p>
// OnError defines the exiting behavior of a container on error
130
-
// can be set to [ continue | stopAndFail ]
130
+
// can be set to [ continue | stopAndFail | continueAndFail ]
131
131
OnErrorOnErrorType`json:"onError,omitempty"`
132
132
// Stores configuration for the stdout stream of the step.
133
133
// +optional
@@ -176,6 +176,8 @@ const (
176
176
StopAndFailOnErrorType="stopAndFail"
177
177
// Continue indicates continue executing the rest of the steps irrespective of the container exit code
178
178
ContinueOnErrorType="continue"
179
+
// Continue indicates continue executing the rest of the steps irrespective of the container exit code and exit after all steps are completed with the first possible non-zero exit code of the step that has this OnErrorType
180
+
ContinueAndFailOnErrorType="continueAndFail"
179
181
)
180
182
181
183
// StepOutputConfig stores configuration for a step output stream.
Copy file name to clipboardexpand all lines: pkg/entrypoint/entrypointer.go
+15-3
Original file line number
Diff line number
Diff line change
@@ -46,9 +46,10 @@ import (
46
46
47
47
// RFC3339 with millisecond
48
48
const (
49
-
timeFormat="2006-01-02T15:04:05.000Z07:00"
50
-
ContinueOnError="continue"
51
-
FailOnError="stopAndFail"
49
+
timeFormat="2006-01-02T15:04:05.000Z07:00"
50
+
ContinueOnError="continue"
51
+
StopAndFailOnError="stopAndFail"
52
+
ContinueAndFailOnError="continueAndFail"
52
53
)
53
54
54
55
const (
@@ -143,6 +144,7 @@ type Entrypointer struct {
143
144
// OnError defines exiting behavior of the entrypoint
144
145
// set it to "stopAndFail" to indicate the entrypoint to exit the taskRun if the container exits with non zero exit code
145
146
// set it to "continue" to indicate the entrypoint to continue executing the rest of the steps irrespective of the container exit code
147
+
// set it to "continueAndFail" to indicate the entrypoint to continue executing the rest of the steps irrespective of the container exit code and exit the taskRun if the container exits with non zero exit code
146
148
OnErrorstring
147
149
// StepMetadataDir is the directory for a step where the step related metadata can be stored
148
150
StepMetadataDirstring
@@ -294,6 +296,16 @@ func (e Entrypointer) Go() error {
err: errors.New("task step onError must be either \"continue\"or \"stopAndFail\" but it is set to an invalid value \"invalid-on-error\""),
717
+
err: errors.New("task step onError must have one of the following values: \"continue\", \"stopAndFail\"or \"continueAndFail\". But it is set to an invalid value \"invalid-on-error\""),
0 commit comments