From 215d56fa348bbf3f86f0ae1fc7a8552e441b37e2 Mon Sep 17 00:00:00 2001 From: Yongxuan Zhang Date: Wed, 15 Mar 2023 20:09:05 +0000 Subject: [PATCH] fix error msg in taskref.resolver.params validation This commit is a small fix to the error message of taskref.resolver.params validation. It adds "resolver" to the "params" validation message to avoid confusion. Signed-off-by: Yongxuan Zhang yongxuanzhang@google.com --- pkg/apis/pipeline/v1/taskref_validation.go | 2 +- pkg/apis/pipeline/v1/taskref_validation_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/apis/pipeline/v1/taskref_validation.go b/pkg/apis/pipeline/v1/taskref_validation.go index 9de49405174..02dca53018d 100644 --- a/pkg/apis/pipeline/v1/taskref_validation.go +++ b/pkg/apis/pipeline/v1/taskref_validation.go @@ -39,7 +39,7 @@ func (ref *TaskRef) Validate(ctx context.Context) (errs *apis.FieldError) { } } if ref.Params != nil { - errs = errs.Also(version.ValidateEnabledAPIFields(ctx, "params", config.BetaAPIFields).ViaField("params")) + errs = errs.Also(version.ValidateEnabledAPIFields(ctx, "resolver params", config.BetaAPIFields).ViaField("params")) if ref.Name != "" { errs = errs.Also(apis.ErrMultipleOneOf("name", "params")) } diff --git a/pkg/apis/pipeline/v1/taskref_validation_test.go b/pkg/apis/pipeline/v1/taskref_validation_test.go index b3e28e192a6..c20ff08bfde 100644 --- a/pkg/apis/pipeline/v1/taskref_validation_test.go +++ b/pkg/apis/pipeline/v1/taskref_validation_test.go @@ -100,7 +100,7 @@ func TestTaskRef_Invalid(t *testing.T) { Params: []v1.Param{}, }, }, - wantErr: apis.ErrMissingField("resolver").Also(apis.ErrGeneric("params requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\"")), + wantErr: apis.ErrMissingField("resolver").Also(apis.ErrGeneric("resolver params requires \"enable-api-fields\" feature gate to be \"alpha\" or \"beta\" but it is \"stable\"")), }, { name: "taskref params disallowed without resolver", taskRef: &v1.TaskRef{