Skip to content

Commit

Permalink
debug is an alpha feature
Browse files Browse the repository at this point in the history
Documenting that the debug feature is still alpha. The feature was
introduced in pipelines release 0.26 behind enable-api-fields flag.
  • Loading branch information
pritidesai authored and tekton-robot committed Feb 16, 2022
1 parent 1375219 commit 7855cb7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
3 changes: 3 additions & 0 deletions docs/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ weight: 11
`Debug` spec is used for troubleshooting and breakpointing runtime resources. This doc helps understand the inner
workings of debug in Tekton. Currently only the `TaskRun` resource is supported.

This is an alpha feature. The `enable-api-fields` feature flag [must be set to `"alpha"`](./install.md)
to specify `debug` in a `taskRun`.

## Debugging TaskRuns

The following provides explanation on how Debugging TaskRuns is possible through Tekton. To understand how to use
Expand Down
1 change: 1 addition & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ Features currently in "alpha" are:
| [Implicit `Parameters`](./taskruns.md#implicit-parameters) | [TEP-0023](https://github.com/tektoncd/community/blob/main/teps/0023-implicit-mapping.md) | [v0.28.0](https://github.com/tektoncd/pipeline/releases/tag/v0.28.0) | |
| [Windows Scripts](./tasks.md#windows-scripts) | [TEP-0057](https://github.com/tektoncd/community/blob/main/teps/0057-windows-support.md) | [v0.28.0](https://github.com/tektoncd/pipeline/releases/tag/v0.28.0) | |
| [Remote Tasks](./taskruns.md#remote-tasks) and [Remote Pipelines](./pipelineruns.md#remote-pipelines) | [TEP-0060](https://github.com/tektoncd/community/blob/main/teps/0060-remote-resolutiond.md) | | |
| [Debug](./debug.md) | [TEP-0042](https://github.com/tektoncd/community/blob/main/teps/0042-taskrun-breakpoint-on-failure.md) | [v0.26.0](https://github.com/tektoncd/pipeline/releases/tag/v0.26.0) | |

## Configuring High Availability

Expand Down
11 changes: 3 additions & 8 deletions pkg/apis/pipeline/v1beta1/taskrun_validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ func (tr *TaskRun) Validate(ctx context.Context) *apis.FieldError {

// Validate taskrun spec
func (ts *TaskRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) {
cfg := config.FromContextOrDefaults(ctx)

// Must have exactly one of taskRef and taskSpec.
if ts.TaskRef == nil && ts.TaskSpec == nil {
errs = errs.Also(apis.ErrMissingOneOf("taskRef", "taskSpec"))
Expand All @@ -61,12 +59,9 @@ func (ts *TaskRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) {
errs = errs.Also(validateParameters(ts.Params).ViaField("params"))
errs = errs.Also(validateWorkspaceBindings(ctx, ts.Workspaces).ViaField("workspaces"))
errs = errs.Also(ts.Resources.Validate(ctx).ViaField("resources"))
if cfg.FeatureFlags.EnableAPIFields == config.AlphaAPIFields {
if ts.Debug != nil {
errs = errs.Also(validateDebug(ts.Debug).ViaField("debug"))
}
} else if ts.Debug != nil {
errs = errs.Also(apis.ErrDisallowedFields("debug"))
if ts.Debug != nil {
errs = errs.Also(ValidateEnabledAPIFields(ctx, "debug", config.AlphaAPIFields).ViaField("debug"))
errs = errs.Also(validateDebug(ts.Debug).ViaField("debug"))
}

if ts.Status != "" {
Expand Down
4 changes: 2 additions & 2 deletions pkg/apis/pipeline/v1beta1/taskrun_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,10 @@ func TestTaskRunSpec_Invalidate(t *testing.T) {
Name: "my-task",
},
Debug: &v1beta1.TaskRunDebug{
Breakpoint: []string{"bReaKdAnCe"},
Breakpoint: []string{"onFailure"},
},
},
wantErr: apis.ErrDisallowedFields("debug"),
wantErr: apis.ErrGeneric("debug requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\""),
}, {
name: "invalid breakpoint",
spec: v1beta1.TaskRunSpec{
Expand Down

0 comments on commit 7855cb7

Please sign in to comment.