Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate some test builder references to structs #3124

Merged
merged 1 commit into from
Sep 1, 2020
Merged
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
124 changes: 0 additions & 124 deletions internal/builder/v1alpha1/condition_test.go

This file was deleted.

154 changes: 0 additions & 154 deletions internal/builder/v1alpha1/examples_test.go

This file was deleted.

6 changes: 3 additions & 3 deletions internal/builder/v1alpha1/param.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1"
// ParamSpecOp is an operation which modify a ParamSpec struct.
type ParamSpecOp func(*v1alpha1.ParamSpec)

// ArrayOrString creates an ArrayOrString of type ParamTypeString or ParamTypeArray, based on
// arrayOrString creates an ArrayOrString of type ParamTypeString or ParamTypeArray, based on
// how many inputs are given (>1 input will create an array, not string).
func ArrayOrString(value string, additionalValues ...string) *v1alpha1.ArrayOrString {
func arrayOrString(value string, additionalValues ...string) *v1alpha1.ArrayOrString {
if len(additionalValues) > 0 {
additionalValues = append([]string{value}, additionalValues...)
return &v1alpha1.ArrayOrString{
Expand All @@ -43,7 +43,7 @@ func ParamSpecDescription(desc string) ParamSpecOp {

// ParamSpecDefault sets the default value of a ParamSpec.
func ParamSpecDefault(value string, additionalValues ...string) ParamSpecOp {
arrayOrString := ArrayOrString(value, additionalValues...)
arrayOrString := arrayOrString(value, additionalValues...)
return func(ps *v1alpha1.ParamSpec) {
ps.Default = arrayOrString
}
Expand Down
44 changes: 0 additions & 44 deletions internal/builder/v1alpha1/param_test.go

This file was deleted.

6 changes: 3 additions & 3 deletions internal/builder/v1alpha1/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func PipelineTaskRefKind(kind v1alpha1.TaskKind) PipelineTaskOp {

// PipelineTaskParam adds a ResourceParam, with specified name and value, to the PipelineTask.
func PipelineTaskParam(name string, value string, additionalValues ...string) PipelineTaskOp {
arrayOrString := ArrayOrString(value, additionalValues...)
arrayOrString := arrayOrString(value, additionalValues...)
return func(pt *v1alpha1.PipelineTask) {
pt.Params = append(pt.Params, v1alpha1.Param{
Name: name,
Expand Down Expand Up @@ -287,7 +287,7 @@ func PipelineTaskConditionParam(name, val string) PipelineTaskConditionOp {
}
condition.Params = append(condition.Params, v1alpha1.Param{
Name: name,
Value: *ArrayOrString(val),
Value: *arrayOrString(val),
})
}
}
Expand Down Expand Up @@ -436,7 +436,7 @@ func PipelineRunServiceAccountNameTask(taskName, sa string) PipelineRunSpecOp {

// PipelineRunParam add a param, with specified name and value, to the PipelineRunSpec.
func PipelineRunParam(name string, value string, additionalValues ...string) PipelineRunSpecOp {
arrayOrString := ArrayOrString(value, additionalValues...)
arrayOrString := arrayOrString(value, additionalValues...)
return func(prs *v1alpha1.PipelineRunSpec) {
prs.Params = append(prs.Params, v1alpha1.Param{
Name: name,
Expand Down
Loading