Skip to content
Open
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
4 changes: 0 additions & 4 deletions pkg/apis/pipeline/v1/taskrun_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,6 @@ func validateDebug(db *TaskRunDebug) (errs *apis.FieldError) {
return errs
}

if db.Breakpoints.OnFailure == "" {
errs = errs.Also(apis.ErrInvalidValue("onFailure breakpoint is empty, it is only allowed to be set as enabled", "breakpoints.onFailure"))
}

if db.Breakpoints.OnFailure != "" && db.Breakpoints.OnFailure != EnabledOnFailureBreakpoint {
errs = errs.Also(apis.ErrInvalidValue(db.Breakpoints.OnFailure+" is not a valid onFailure breakpoint value, onFailure breakpoint is only allowed to be set as enabled", "breakpoints.onFailure"))
}
Expand Down
7 changes: 3 additions & 4 deletions pkg/apis/pipeline/v1/taskrun_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -751,19 +751,18 @@ func TestTaskRunSpec_Invalidate(t *testing.T) {
wantErr: apis.ErrGeneric("before step must be unique, the same step: step-1 is defined multiple times at", "debug.breakpoints.beforeSteps[1]"),
wc: cfgtesting.EnableAlphaAPIFields,
}, {
name: "empty onFailure breakpoint",
name: "breakpoints with only beforeSteps set",
spec: v1.TaskRunSpec{
TaskRef: &v1.TaskRef{
Name: "my-task",
},
Debug: &v1.TaskRunDebug{
Breakpoints: &v1.TaskBreakpoints{
OnFailure: "",
BeforeSteps: []string{"step-1"},
},
},
},
wantErr: apis.ErrInvalidValue("onFailure breakpoint is empty, it is only allowed to be set as enabled", "debug.breakpoints.onFailure"),
wc: cfgtesting.EnableAlphaAPIFields,
wc: cfgtesting.EnableAlphaAPIFields,
}, {
name: "stepSpecs disallowed without beta feature gate",
spec: v1.TaskRunSpec{
Expand Down
4 changes: 0 additions & 4 deletions pkg/apis/pipeline/v1beta1/taskrun_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,6 @@ func validateDebug(db *TaskRunDebug) (errs *apis.FieldError) {
return errs
}

if db.Breakpoints.OnFailure == "" {
errs = errs.Also(apis.ErrInvalidValue("onFailure breakpoint is empty, it is only allowed to be set as enabled", "breakpoints.onFailure"))
}

if db.Breakpoints.OnFailure != "" && db.Breakpoints.OnFailure != EnabledOnFailureBreakpoint {
errs = errs.Also(apis.ErrInvalidValue(db.Breakpoints.OnFailure+" is not a valid onFailure breakpoint value, onFailure breakpoint is only allowed to be set as enabled", "breakpoints.onFailure"))
}
Expand Down
7 changes: 3 additions & 4 deletions pkg/apis/pipeline/v1beta1/taskrun_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -745,19 +745,18 @@ func TestTaskRunSpec_Invalidate(t *testing.T) {
wantErr: apis.ErrGeneric("before step must be unique, the same step: step-1 is defined multiple times at", "debug.breakpoints.beforeSteps[1]"),
wc: cfgtesting.EnableAlphaAPIFields,
}, {
name: "empty onFailure breakpoint",
name: "breakpoints with only beforeSteps set",
spec: v1beta1.TaskRunSpec{
TaskRef: &v1beta1.TaskRef{
Name: "my-task",
},
Debug: &v1beta1.TaskRunDebug{
Breakpoints: &v1beta1.TaskBreakpoints{
OnFailure: "",
BeforeSteps: []string{"step-1"},
},
},
},
wantErr: apis.ErrInvalidValue("onFailure breakpoint is empty, it is only allowed to be set as enabled", "debug.breakpoints.onFailure"),
wc: cfgtesting.EnableAlphaAPIFields,
wc: cfgtesting.EnableAlphaAPIFields,
}, {
name: "duplicate stepOverride names",
spec: v1beta1.TaskRunSpec{
Expand Down