diff --git a/docs/additional-configs.md b/docs/additional-configs.md index 3e517eec5fa..dc7473fc0c6 100644 --- a/docs/additional-configs.md +++ b/docs/additional-configs.md @@ -375,7 +375,6 @@ Features currently in "alpha" are: | [Hermetic Execution Mode](./hermetic.md) | [TEP-0025](https://github.com/tektoncd/community/blob/main/teps/0025-hermekton.md) | [v0.25.0](https://github.com/tektoncd/pipeline/releases/tag/v0.25.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) | | | [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) | | -| [Step and Sidecar Overrides](./taskruns.md#overriding-task-steps-and-sidecars) | [TEP-0094](https://github.com/tektoncd/community/blob/main/teps/0094-specifying-resource-requirements-at-runtime.md) | [v0.34.0](https://github.com/tektoncd/pipeline/releases/tag/v0.34.0) | | | [StdoutConfig and StderrConfig](./tasks#redirecting-step-output-streams-with-stdoutConfig-and-stderrConfig) | [TEP-0011](https://github.com/tektoncd/community/blob/main/teps/0011-redirecting-step-output-streams.md) | [v0.38.0](https://github.com/tektoncd/pipeline/releases/tag/v0.38.0) | | | [Trusted Resources](./trusted-resources.md) | [TEP-0091](https://github.com/tektoncd/community/blob/main/teps/0091-trusted-resources.md) | [v0.49.0](https://github.com/tektoncd/pipeline/releases/tag/v0.49.0) | `trusted-resources-verification-no-match-policy` | | [Configure Default Resolver](./resolution.md#configuring-built-in-resolvers) | [TEP-0133](https://github.com/tektoncd/community/blob/main/teps/0133-configure-default-resolver.md) | [v0.46.0](https://github.com/tektoncd/pipeline/releases/tag/v0.46.0) | | @@ -403,6 +402,7 @@ Features currently in "beta" are: | [Task-level Resource Requirements](compute-resources.md#task-level-compute-resources-configuration) | [TEP-0104](https://github.com/tektoncd/community/blob/main/teps/0104-tasklevel-resource-requirements.md) | [v0.39.0](https://github.com/tektoncd/pipeline/releases/tag/v0.39.0) | [v0.53.0](https://github.com/tektoncd/pipeline/releases/tag/v0.53.0) | | | [Reusable Steps via StepActions](./stepactions.md) | [TEP-0142](https://github.com/tektoncd/community/blob/main/teps/0142-enable-step-reusability.md) | [v0.54.0](https://github.com/tektoncd/pipeline/releases/tag/v0.54.0) | `enable-step-actions` | | [Larger Results via Sidecar Logs](#enabling-larger-results-using-sidecar-logs) | [TEP-0127](https://github.com/tektoncd/community/blob/main/teps/0127-larger-results-via-sidecar-logs.md) | [v0.43.0](https://github.com/tektoncd/pipeline/releases/tag/v0.43.0) | [v0.61.0](https://github.com/tektoncd/pipeline/releases/tag/v0.61.0) | `results-from` | +| [Step and Sidecar Overrides](./taskruns.md#overriding-task-steps-and-sidecars) | [TEP-0094](https://github.com/tektoncd/community/blob/main/teps/0094-specifying-resource-requirements-at-runtime.md) | [v0.34.0](https://github.com/tektoncd/pipeline/releases/tag/v0.34.0) | | [v0.61.0](https://github.com/tektoncd/pipeline/releases/tag/v0.61.0) | ## Enabling larger results using sidecar logs diff --git a/docs/taskruns.md b/docs/taskruns.md index d689b69f3ec..8e0a4886506 100644 --- a/docs/taskruns.md +++ b/docs/taskruns.md @@ -599,7 +599,7 @@ and reasons. ### Configuring Task Steps and Sidecars in a TaskRun -**([alpha only](https://github.com/tektoncd/pipeline/blob/main/docs/additional-configs.md#alpha-features))** +**([beta only](https://github.com/tektoncd/pipeline/blob/main/docs/additional-configs.md#beta-features))** A TaskRun can specify `StepSpecs` or `SidecarSpecs` to configure Step or Sidecar specified in a Task. Only named Steps and Sidecars may be configured. diff --git a/pkg/apis/pipeline/v1/pipelinerun_validation.go b/pkg/apis/pipeline/v1/pipelinerun_validation.go index d45b00ab8e3..37c977197b0 100644 --- a/pkg/apis/pipeline/v1/pipelinerun_validation.go +++ b/pkg/apis/pipeline/v1/pipelinerun_validation.go @@ -286,11 +286,11 @@ func (ps *PipelineRunSpec) validatePipelineTimeout(timeout time.Duration, errorM func validateTaskRunSpec(ctx context.Context, trs PipelineTaskRunSpec) (errs *apis.FieldError) { if trs.StepSpecs != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepSpecs", config.AlphaAPIFields).ViaField("stepSpecs")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepSpecs", config.BetaAPIFields).ViaField("stepSpecs")) errs = errs.Also(validateStepSpecs(trs.StepSpecs).ViaField("stepSpecs")) } if trs.SidecarSpecs != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarSpecs", config.AlphaAPIFields).ViaField("sidecarSpecs")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarSpecs", config.BetaAPIFields).ViaField("sidecarSpecs")) errs = errs.Also(validateSidecarSpecs(trs.SidecarSpecs).ViaField("sidecarSpecs")) } if trs.ComputeResources != nil { diff --git a/pkg/apis/pipeline/v1/pipelinerun_validation_test.go b/pkg/apis/pipeline/v1/pipelinerun_validation_test.go index 8e7f24a0e87..2962ddf6c81 100644 --- a/pkg/apis/pipeline/v1/pipelinerun_validation_test.go +++ b/pkg/apis/pipeline/v1/pipelinerun_validation_test.go @@ -970,7 +970,7 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { wantErr: apis.ErrMultipleOneOf("taskRunSpecs[0].stepSpecs[1].name"), withContext: cfgtesting.EnableAlphaAPIFields, }, { - name: "stepSpecs disallowed without alpha feature gate", + name: "stepSpecs disallowed without beta feature gate", spec: v1.PipelineRunSpec{ PipelineRef: &v1.PipelineRef{Name: "foo"}, TaskRunSpecs: []v1.PipelineTaskRunSpec{ @@ -986,9 +986,9 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { }, }, withContext: cfgtesting.EnableStableAPIFields, - wantErr: apis.ErrGeneric("stepSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), + wantErr: apis.ErrGeneric("stepSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), }, { - name: "sidecarSpec disallowed without alpha feature gate", + name: "sidecarSpec disallowed without beta feature gate", spec: v1.PipelineRunSpec{ PipelineRef: &v1.PipelineRef{Name: "foo"}, TaskRunSpecs: []v1.PipelineTaskRunSpec{ @@ -1004,7 +1004,7 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { }, }, withContext: cfgtesting.EnableStableAPIFields, - wantErr: apis.ErrGeneric("sidecarSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), + wantErr: apis.ErrGeneric("sidecarSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), }, { name: "missing stepSpecs name", spec: v1.PipelineRunSpec{ @@ -1077,7 +1077,7 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { "taskRunSpecs[0].stepSpecs.resources", "taskRunSpecs[0].computeResources", ), - withContext: cfgtesting.EnableAlphaAPIFields, + withContext: cfgtesting.EnableBetaAPIFields, }, { name: "computeResources disallowed without beta feature gate", spec: v1.PipelineRunSpec{ @@ -1140,7 +1140,7 @@ func TestPipelineRunSpec_Validate(t *testing.T) { }, }}, }, - withContext: cfgtesting.EnableAlphaAPIFields, + withContext: cfgtesting.EnableBetaAPIFields, }, { name: "valid sidecar and task-level (taskRunSpecs.resources) resource requirements configured", spec: v1.PipelineRunSpec{ @@ -1163,7 +1163,7 @@ func TestPipelineRunSpec_Validate(t *testing.T) { }}, }}, }, - withContext: cfgtesting.EnableAlphaAPIFields, + withContext: cfgtesting.EnableBetaAPIFields, }} for _, ps := range tests { diff --git a/pkg/apis/pipeline/v1/taskrun_validation.go b/pkg/apis/pipeline/v1/taskrun_validation.go index 771d684d40c..f2aafa23f74 100644 --- a/pkg/apis/pipeline/v1/taskrun_validation.go +++ b/pkg/apis/pipeline/v1/taskrun_validation.go @@ -80,11 +80,11 @@ func (ts *TaskRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) { errs = errs.Also(validateDebug(ts.Debug).ViaField("debug")) } if ts.StepSpecs != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepSpecs", config.AlphaAPIFields).ViaField("stepSpecs")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepSpecs", config.BetaAPIFields).ViaField("stepSpecs")) errs = errs.Also(validateStepSpecs(ts.StepSpecs).ViaField("stepSpecs")) } if ts.SidecarSpecs != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarSpecs", config.AlphaAPIFields).ViaField("sidecarSpecs")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarSpecs", config.BetaAPIFields).ViaField("sidecarSpecs")) errs = errs.Also(validateSidecarSpecs(ts.SidecarSpecs).ViaField("sidecarSpecs")) } if ts.ComputeResources != nil { diff --git a/pkg/apis/pipeline/v1/taskrun_validation_test.go b/pkg/apis/pipeline/v1/taskrun_validation_test.go index 978b3164a1c..33689e325ec 100644 --- a/pkg/apis/pipeline/v1/taskrun_validation_test.go +++ b/pkg/apis/pipeline/v1/taskrun_validation_test.go @@ -416,7 +416,7 @@ func TestTaskRun_Validate(t *testing.T) { }, wc: cfgtesting.EnableAlphaAPIFields, }, { - name: "alpha feature: valid step and sidecar specs", + name: "beta feature: valid step and sidecar specs", taskRun: &v1.TaskRun{ ObjectMeta: metav1.ObjectMeta{Name: "tr"}, Spec: v1.TaskRunSpec{ @@ -435,7 +435,7 @@ func TestTaskRun_Validate(t *testing.T) { }}, }, }, - wc: cfgtesting.EnableAlphaAPIFields, + wc: cfgtesting.EnableBetaAPIFields, }} for _, ts := range tests { t.Run(ts.name, func(t *testing.T) { @@ -704,7 +704,7 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { wantErr: apis.ErrInvalidValue("turnOn is not a valid onFailure breakpoint value, onFailure breakpoint is only allowed to be set as enabled", "debug.breakpoints.onFailure"), wc: cfgtesting.EnableAlphaAPIFields, }, { - name: "stepSpecs disallowed without alpha feature gate", + name: "stepSpecs disallowed without beta feature gate", spec: v1.TaskRunSpec{ TaskRef: &v1.TaskRef{ Name: "foo", @@ -717,9 +717,9 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { }}, }, wc: cfgtesting.EnableStableAPIFields, - wantErr: apis.ErrGeneric("stepSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\""), + wantErr: apis.ErrGeneric("stepSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\""), }, { - name: "sidecarSpec disallowed without alpha feature gate", + name: "sidecarSpec disallowed without beta feature gate", spec: v1.TaskRunSpec{ TaskRef: &v1.TaskRef{ Name: "foo", @@ -732,7 +732,7 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { }}, }, wc: cfgtesting.EnableStableAPIFields, - wantErr: apis.ErrGeneric("sidecarSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\""), + wantErr: apis.ErrGeneric("sidecarSpecs requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\""), }, { name: "duplicate stepSpecs names", spec: v1.TaskRunSpec{ @@ -815,7 +815,7 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { "stepSpecs.resources", "computeResources", ), - wc: cfgtesting.EnableAlphaAPIFields, + wc: cfgtesting.EnableBetaAPIFields, }, { name: "computeResources disallowed without beta feature gate", spec: v1.TaskRunSpec{ diff --git a/pkg/apis/pipeline/v1beta1/pipelinerun_validation.go b/pkg/apis/pipeline/v1beta1/pipelinerun_validation.go index 7113b653620..31fe4fb7281 100644 --- a/pkg/apis/pipeline/v1beta1/pipelinerun_validation.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_validation.go @@ -335,11 +335,11 @@ func (ps *PipelineRunSpec) validatePipelineTimeout(timeout time.Duration, errorM func validateTaskRunSpec(ctx context.Context, trs PipelineTaskRunSpec) (errs *apis.FieldError) { if trs.StepOverrides != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepOverrides", config.AlphaAPIFields).ViaField("stepOverrides")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepOverrides", config.BetaAPIFields).ViaField("stepOverrides")) errs = errs.Also(validateStepOverrides(trs.StepOverrides).ViaField("stepOverrides")) } if trs.SidecarOverrides != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarOverrides", config.AlphaAPIFields).ViaField("sidecarOverrides")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarOverrides", config.BetaAPIFields).ViaField("sidecarOverrides")) errs = errs.Also(validateSidecarOverrides(trs.SidecarOverrides).ViaField("sidecarOverrides")) } if trs.ComputeResources != nil { diff --git a/pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go b/pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go index 706078d181c..2d8fb19833e 100644 --- a/pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_validation_test.go @@ -949,7 +949,7 @@ func TestPipelineRun_Validate(t *testing.T) { }, }, }, { - name: "alpha feature: sidecar and step overrides", + name: "beta feature: sidecar and step overrides", pr: v1beta1.PipelineRun{ ObjectMeta: metav1.ObjectMeta{ Name: "pr", @@ -979,7 +979,7 @@ func TestPipelineRun_Validate(t *testing.T) { }, }, }, - wc: cfgtesting.EnableAlphaAPIFields, + wc: cfgtesting.EnableBetaAPIFields, }} for _, ts := range tests { @@ -1109,7 +1109,7 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { wantErr: apis.ErrMultipleOneOf("taskRunSpecs[0].stepOverrides[1].name"), withContext: cfgtesting.EnableAlphaAPIFields, }, { - name: "stepOverride disallowed without alpha feature gate", + name: "stepOverride disallowed without alpha or beta feature gate", spec: v1beta1.PipelineRunSpec{ PipelineRef: &v1beta1.PipelineRef{Name: "foo"}, TaskRunSpecs: []v1beta1.PipelineTaskRunSpec{ @@ -1127,9 +1127,9 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { }, }, withContext: cfgtesting.EnableStableAPIFields, - wantErr: apis.ErrGeneric("stepOverrides requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), + wantErr: apis.ErrGeneric("stepOverrides requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), }, { - name: "sidecarOverride disallowed without alpha feature gate", + name: "sidecarOverride disallowed without alpha or beta feature gate", spec: v1beta1.PipelineRunSpec{ PipelineRef: &v1beta1.PipelineRef{Name: "foo"}, TaskRunSpecs: []v1beta1.PipelineTaskRunSpec{ @@ -1147,7 +1147,7 @@ func TestPipelineRunSpec_Invalidate(t *testing.T) { }, }, withContext: cfgtesting.EnableStableAPIFields, - wantErr: apis.ErrGeneric("sidecarOverrides requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), + wantErr: apis.ErrGeneric("sidecarOverrides requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\"").ViaIndex(0).ViaField("taskRunSpecs"), }, { name: "missing stepOverride name", spec: v1beta1.PipelineRunSpec{ diff --git a/pkg/apis/pipeline/v1beta1/taskrun_validation.go b/pkg/apis/pipeline/v1beta1/taskrun_validation.go index b44b3d42e2c..a82996439f7 100644 --- a/pkg/apis/pipeline/v1beta1/taskrun_validation.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_validation.go @@ -80,11 +80,11 @@ func (ts *TaskRunSpec) Validate(ctx context.Context) (errs *apis.FieldError) { errs = errs.Also(validateDebug(ts.Debug).ViaField("debug")) } if ts.StepOverrides != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepOverrides", config.AlphaAPIFields).ViaField("stepOverrides")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "stepOverrides", config.BetaAPIFields).ViaField("stepOverrides")) errs = errs.Also(validateStepOverrides(ts.StepOverrides).ViaField("stepOverrides")) } if ts.SidecarOverrides != nil { - errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarOverrides", config.AlphaAPIFields).ViaField("sidecarOverrides")) + errs = errs.Also(config.ValidateEnabledAPIFields(ctx, "sidecarOverrides", config.BetaAPIFields).ViaField("sidecarOverrides")) errs = errs.Also(validateSidecarOverrides(ts.SidecarOverrides).ViaField("sidecarOverrides")) } if ts.ComputeResources != nil { diff --git a/pkg/apis/pipeline/v1beta1/taskrun_validation_test.go b/pkg/apis/pipeline/v1beta1/taskrun_validation_test.go index e63fdfd21da..9bbf77036b9 100644 --- a/pkg/apis/pipeline/v1beta1/taskrun_validation_test.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_validation_test.go @@ -446,7 +446,7 @@ func TestTaskRun_Validate(t *testing.T) { }, }, }, { - name: "alpha feature: valid step and sidecar overrides", + name: "beta feature: valid step and sidecar overrides", taskRun: &v1beta1.TaskRun{ ObjectMeta: metav1.ObjectMeta{Name: "tr"}, Spec: v1beta1.TaskRunSpec{ @@ -465,7 +465,7 @@ func TestTaskRun_Validate(t *testing.T) { }}, }, }, - wc: cfgtesting.EnableAlphaAPIFields, + wc: cfgtesting.EnableBetaAPIFields, }} for _, ts := range tests { t.Run(ts.name, func(t *testing.T) { @@ -698,36 +698,6 @@ func TestTaskRunSpec_Invalidate(t *testing.T) { }, wantErr: apis.ErrInvalidValue("turnOn is not a valid onFailure breakpoint value, onFailure breakpoint is only allowed to be set as enabled", "debug.breakpoints.onFailure"), wc: cfgtesting.EnableAlphaAPIFields, - }, { - name: "stepOverride disallowed without alpha feature gate", - spec: v1beta1.TaskRunSpec{ - TaskRef: &v1beta1.TaskRef{ - Name: "foo", - }, - StepOverrides: []v1beta1.TaskRunStepOverride{{ - Name: "foo", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, - }, - }}, - }, - wc: cfgtesting.EnableStableAPIFields, - wantErr: apis.ErrGeneric("stepOverrides requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\""), - }, { - name: "sidecarOverride disallowed without alpha feature gate", - spec: v1beta1.TaskRunSpec{ - TaskRef: &v1beta1.TaskRef{ - Name: "foo", - }, - SidecarOverrides: []v1beta1.TaskRunSidecarOverride{{ - Name: "foo", - Resources: corev1.ResourceRequirements{ - Requests: corev1.ResourceList{corev1.ResourceMemory: corev1resources.MustParse("1Gi")}, - }, - }}, - }, - wc: cfgtesting.EnableStableAPIFields, - wantErr: apis.ErrGeneric("sidecarOverrides requires \"enable-api-fields\" feature gate to be \"alpha\" but it is \"stable\""), }, { name: "duplicate stepOverride names", spec: v1beta1.TaskRunSpec{ @@ -940,7 +910,7 @@ func TestTaskRunSpec_Validate(t *testing.T) { }, }}, }, - wc: cfgtesting.EnableAlphaAPIFields, + wc: cfgtesting.EnableBetaAPIFields, }} for _, ts := range tests {