@@ -27,7 +27,6 @@ import (
27
27
"github.com/tektoncd/pipeline/pkg/apis/config"
28
28
"github.com/tektoncd/pipeline/pkg/apis/pipeline"
29
29
"github.com/tektoncd/pipeline/pkg/apis/validate"
30
- "github.com/tektoncd/pipeline/pkg/apis/version"
31
30
"github.com/tektoncd/pipeline/pkg/substitution"
32
31
admissionregistrationv1 "k8s.io/api/admissionregistration/v1"
33
32
corev1 "k8s.io/api/core/v1"
@@ -109,21 +108,21 @@ func (ts *TaskSpec) ValidateBetaFields(ctx context.Context) *apis.FieldError {
109
108
// Object parameters
110
109
for i , p := range ts .Params {
111
110
if p .Type == ParamTypeObject {
112
- errs = errs .Also (version .ValidateEnabledAPIFields (ctx , "object type parameter" , config .BetaAPIFields ).ViaFieldIndex ("params" , i ))
111
+ errs = errs .Also (config .ValidateEnabledAPIFields (ctx , "object type parameter" , config .BetaAPIFields ).ViaFieldIndex ("params" , i ))
113
112
}
114
113
}
115
114
// Indexing into array parameters
116
115
arrayIndexParamRefs := ts .GetIndexingReferencesToArrayParams ()
117
116
if len (arrayIndexParamRefs ) != 0 {
118
- errs = errs .Also (version .ValidateEnabledAPIFields (ctx , "indexing into array parameters" , config .BetaAPIFields ))
117
+ errs = errs .Also (config .ValidateEnabledAPIFields (ctx , "indexing into array parameters" , config .BetaAPIFields ))
119
118
}
120
119
// Array and object results
121
120
for i , result := range ts .Results {
122
121
switch result .Type {
123
122
case ResultsTypeObject :
124
- errs = errs .Also (version .ValidateEnabledAPIFields (ctx , "object results" , config .BetaAPIFields ).ViaFieldIndex ("results" , i ))
123
+ errs = errs .Also (config .ValidateEnabledAPIFields (ctx , "object results" , config .BetaAPIFields ).ViaFieldIndex ("results" , i ))
125
124
case ResultsTypeArray :
126
- errs = errs .Also (version .ValidateEnabledAPIFields (ctx , "array results" , config .BetaAPIFields ).ViaFieldIndex ("results" , i ))
125
+ errs = errs .Also (config .ValidateEnabledAPIFields (ctx , "array results" , config .BetaAPIFields ).ViaFieldIndex ("results" , i ))
127
126
case ResultsTypeString :
128
127
default :
129
128
}
@@ -222,7 +221,7 @@ func validateWorkspaceUsages(ctx context.Context, ts *TaskSpec) (errs *apis.Fiel
222
221
223
222
for stepIdx , step := range steps {
224
223
if len (step .Workspaces ) != 0 {
225
- errs = errs .Also (version .ValidateEnabledAPIFields (ctx , "step workspaces" , config .BetaAPIFields ).ViaIndex (stepIdx ).ViaField ("steps" ))
224
+ errs = errs .Also (config .ValidateEnabledAPIFields (ctx , "step workspaces" , config .BetaAPIFields ).ViaIndex (stepIdx ).ViaField ("steps" ))
226
225
}
227
226
for workspaceIdx , w := range step .Workspaces {
228
227
if ! wsNames .Has (w .Name ) {
@@ -233,7 +232,7 @@ func validateWorkspaceUsages(ctx context.Context, ts *TaskSpec) (errs *apis.Fiel
233
232
234
233
for sidecarIdx , sidecar := range sidecars {
235
234
if len (sidecar .Workspaces ) != 0 {
236
- errs = errs .Also (version .ValidateEnabledAPIFields (ctx , "sidecar workspaces" , config .BetaAPIFields ).ViaIndex (sidecarIdx ).ViaField ("sidecars" ))
235
+ errs = errs .Also (config .ValidateEnabledAPIFields (ctx , "sidecar workspaces" , config .BetaAPIFields ).ViaIndex (sidecarIdx ).ViaField ("sidecars" ))
237
236
}
238
237
for workspaceIdx , w := range sidecar .Workspaces {
239
238
if ! wsNames .Has (w .Name ) {
@@ -325,19 +324,19 @@ func validateStep(ctx context.Context, s Step, names sets.String) (errs *apis.Fi
325
324
if s .Script != "" {
326
325
cleaned := strings .TrimSpace (s .Script )
327
326
if strings .HasPrefix (cleaned , "#!win" ) {
328
- errs = errs .Also (version .ValidateEnabledAPIFields (ctx , "windows script support" , config .AlphaAPIFields ).ViaField ("script" ))
327
+ errs = errs .Also (config .ValidateEnabledAPIFields (ctx , "windows script support" , config .AlphaAPIFields ).ViaField ("script" ))
329
328
}
330
329
}
331
330
332
331
// StdoutConfig is an alpha feature and will fail validation if it's used in a task spec
333
332
// when the enable-api-fields feature gate is not "alpha".
334
333
if s .StdoutConfig != nil {
335
- errs = errs .Also (version .ValidateEnabledAPIFields (ctx , "step stdout stream support" , config .AlphaAPIFields ).ViaField ("stdoutconfig" ))
334
+ errs = errs .Also (config .ValidateEnabledAPIFields (ctx , "step stdout stream support" , config .AlphaAPIFields ).ViaField ("stdoutconfig" ))
336
335
}
337
336
// StderrConfig is an alpha feature and will fail validation if it's used in a task spec
338
337
// when the enable-api-fields feature gate is not "alpha".
339
338
if s .StderrConfig != nil {
340
- errs = errs .Also (version .ValidateEnabledAPIFields (ctx , "step stderr stream support" , config .AlphaAPIFields ).ViaField ("stderrconfig" ))
339
+ errs = errs .Also (config .ValidateEnabledAPIFields (ctx , "step stderr stream support" , config .AlphaAPIFields ).ViaField ("stderrconfig" ))
341
340
}
342
341
return errs
343
342
}
0 commit comments