Skip to content

Commit

Permalink
Clean Up: Update []Param to the new Params type
Browse files Browse the repository at this point in the history
This commit updates []Param to the new Params type everywhere in the code base. This is a follow up to PR #6180 where the type type Params []Param was introduced to allow member functions.
This change will make it easier to make changes related to the type.
  • Loading branch information
EmmaMunley authored and tekton-robot committed Mar 30, 2023
1 parent 87aa800 commit 54c0f84
Show file tree
Hide file tree
Showing 67 changed files with 567 additions and 570 deletions.
69 changes: 33 additions & 36 deletions docs/pipeline-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,8 @@ PipelineSpec
<td>
<code>params</code><br/>
<em>
<a href="#tekton.dev/v1.Param">
[]Param
<a href="#tekton.dev/v1.Params">
Params
</a>
</em>
</td>
Expand Down Expand Up @@ -1097,8 +1097,8 @@ TaskRunDebug
<td>
<code>params</code><br/>
<em>
<a href="#tekton.dev/v1.Param">
[]Param
<a href="#tekton.dev/v1.Params">
Params
</a>
</em>
</td>
Expand Down Expand Up @@ -1617,9 +1617,6 @@ IncludeParamsList
</table>
<h3 id="tekton.dev/v1.Param">Param
</h3>
<p>
(<em>Appears on:</em><a href="#tekton.dev/v1.PipelineRunSpec">PipelineRunSpec</a>, <a href="#tekton.dev/v1.ResolverRef">ResolverRef</a>, <a href="#tekton.dev/v1.TaskRunInputs">TaskRunInputs</a>, <a href="#tekton.dev/v1.TaskRunSpec">TaskRunSpec</a>)
</p>
<div>
<p>Param declares an ParamValues to use for the parameter called name.</p>
</div>
Expand Down Expand Up @@ -1837,7 +1834,7 @@ map[string]string
<h3 id="tekton.dev/v1.Params">Params
(<code>[]github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Param</code> alias)</h3>
<p>
(<em>Appears on:</em><a href="#tekton.dev/v1.IncludeParams">IncludeParams</a>, <a href="#tekton.dev/v1.Matrix">Matrix</a>, <a href="#tekton.dev/v1.PipelineTask">PipelineTask</a>)
(<em>Appears on:</em><a href="#tekton.dev/v1.IncludeParams">IncludeParams</a>, <a href="#tekton.dev/v1.Matrix">Matrix</a>, <a href="#tekton.dev/v1.PipelineRunSpec">PipelineRunSpec</a>, <a href="#tekton.dev/v1.PipelineTask">PipelineTask</a>, <a href="#tekton.dev/v1.ResolverRef">ResolverRef</a>, <a href="#tekton.dev/v1.TaskRunInputs">TaskRunInputs</a>, <a href="#tekton.dev/v1.TaskRunSpec">TaskRunSpec</a>)
</p>
<div>
<p>Params is a list of Param</p>
Expand Down Expand Up @@ -2162,8 +2159,8 @@ PipelineSpec
<td>
<code>params</code><br/>
<em>
<a href="#tekton.dev/v1.Param">
[]Param
<a href="#tekton.dev/v1.Params">
Params
</a>
</em>
</td>
Expand Down Expand Up @@ -3222,8 +3219,8 @@ resolution of the referenced Tekton resource, such as &ldquo;git&rdquo;.</p>
<td>
<code>params</code><br/>
<em>
<a href="#tekton.dev/v1.Param">
[]Param
<a href="#tekton.dev/v1.Params">
Params
</a>
</em>
</td>
Expand Down Expand Up @@ -4699,8 +4696,8 @@ string
<td>
<code>params</code><br/>
<em>
<a href="#tekton.dev/v1.Param">
[]Param
<a href="#tekton.dev/v1.Params">
Params
</a>
</em>
</td>
Expand Down Expand Up @@ -4885,8 +4882,8 @@ TaskRunDebug
<td>
<code>params</code><br/>
<em>
<a href="#tekton.dev/v1.Param">
[]Param
<a href="#tekton.dev/v1.Params">
Params
</a>
</em>
</td>
Expand Down Expand Up @@ -6023,8 +6020,8 @@ EmbeddedRunSpec
<td>
<code>params</code><br/>
<em>
<a href="#tekton.dev/v1beta1.Param">
[]Param
<a href="#tekton.dev/v1beta1.Params">
Params
</a>
</em>
</td>
Expand Down Expand Up @@ -6548,8 +6545,8 @@ EmbeddedRunSpec
<td>
<code>params</code><br/>
<em>
<a href="#tekton.dev/v1beta1.Param">
[]Param
<a href="#tekton.dev/v1beta1.Params">
Params
</a>
</em>
</td>
Expand Down Expand Up @@ -7211,8 +7208,8 @@ EmbeddedCustomRunSpec
<td>
<code>params</code><br/>
<em>
<a href="#tekton.dev/v1beta1.Param">
[]Param
<a href="#tekton.dev/v1beta1.Params">
Params
</a>
</em>
</td>
Expand Down Expand Up @@ -7574,8 +7571,8 @@ PipelineSpec
<td>
<code>params</code><br/>
<em>
<a href="#tekton.dev/v1beta1.Param">
[]Param
<a href="#tekton.dev/v1beta1.Params">
Params
</a>
</em>
</td>
Expand Down Expand Up @@ -7972,8 +7969,8 @@ TaskRunDebug
<td>
<code>params</code><br/>
<em>
<a href="#tekton.dev/v1beta1.Param">
[]Param
<a href="#tekton.dev/v1beta1.Params">
Params
</a>
</em>
</td>
Expand Down Expand Up @@ -8460,8 +8457,8 @@ EmbeddedCustomRunSpec
<td>
<code>params</code><br/>
<em>
<a href="#tekton.dev/v1beta1.Param">
[]Param
<a href="#tekton.dev/v1beta1.Params">
Params
</a>
</em>
</td>
Expand Down Expand Up @@ -8825,7 +8822,7 @@ IncludeParamsList
<h3 id="tekton.dev/v1beta1.Param">Param
</h3>
<p>
(<em>Appears on:</em><a href="#tekton.dev/v1alpha1.RunSpec">RunSpec</a>, <a href="#tekton.dev/v1beta1.CustomRunSpec">CustomRunSpec</a>, <a href="#tekton.dev/v1beta1.PipelineRunSpec">PipelineRunSpec</a>, <a href="#tekton.dev/v1beta1.ResolverRef">ResolverRef</a>, <a href="#tekton.dev/v1beta1.TaskRunSpec">TaskRunSpec</a>, <a href="#resolution.tekton.dev/v1beta1.ResolutionRequestSpec">ResolutionRequestSpec</a>)
(<em>Appears on:</em><a href="#resolution.tekton.dev/v1beta1.ResolutionRequestSpec">ResolutionRequestSpec</a>)
</p>
<div>
<p>Param declares an ParamValues to use for the parameter called name.</p>
Expand Down Expand Up @@ -9029,7 +9026,7 @@ map[string]string
<h3 id="tekton.dev/v1beta1.Params">Params
(<code>[]github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1.Param</code> alias)</h3>
<p>
(<em>Appears on:</em><a href="#tekton.dev/v1beta1.IncludeParams">IncludeParams</a>, <a href="#tekton.dev/v1beta1.Matrix">Matrix</a>, <a href="#tekton.dev/v1beta1.PipelineTask">PipelineTask</a>)
(<em>Appears on:</em><a href="#tekton.dev/v1alpha1.RunSpec">RunSpec</a>, <a href="#tekton.dev/v1beta1.CustomRunSpec">CustomRunSpec</a>, <a href="#tekton.dev/v1beta1.IncludeParams">IncludeParams</a>, <a href="#tekton.dev/v1beta1.Matrix">Matrix</a>, <a href="#tekton.dev/v1beta1.PipelineRunSpec">PipelineRunSpec</a>, <a href="#tekton.dev/v1beta1.PipelineTask">PipelineTask</a>, <a href="#tekton.dev/v1beta1.ResolverRef">ResolverRef</a>, <a href="#tekton.dev/v1beta1.TaskRunSpec">TaskRunSpec</a>)
</p>
<div>
<p>Params is a list of Param</p>
Expand Down Expand Up @@ -9394,8 +9391,8 @@ PipelineSpec
<td>
<code>params</code><br/>
<em>
<a href="#tekton.dev/v1beta1.Param">
[]Param
<a href="#tekton.dev/v1beta1.Params">
Params
</a>
</em>
</td>
Expand Down Expand Up @@ -10475,8 +10472,8 @@ resolution of the referenced Tekton resource, such as &ldquo;git&rdquo;.</p>
<td>
<code>params</code><br/>
<em>
<a href="#tekton.dev/v1beta1.Param">
[]Param
<a href="#tekton.dev/v1beta1.Params">
Params
</a>
</em>
</td>
Expand Down Expand Up @@ -12395,8 +12392,8 @@ TaskRunDebug
<td>
<code>params</code><br/>
<em>
<a href="#tekton.dev/v1beta1.Param">
[]Param
<a href="#tekton.dev/v1beta1.Params">
Params
</a>
</em>
</td>
Expand Down
44 changes: 22 additions & 22 deletions pkg/apis/pipeline/v1/matrix_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,19 @@ func TestMatrix_FanOut(t *testing.T) {
matrix: Matrix{
Include: IncludeParamsList{{
Name: "build-1",
Params: []Param{{
Params: Params{{
Name: "IMAGE", Value: ParamValue{Type: ParamTypeString, StringVal: "image-1"},
}, {
Name: "DOCKERFILE", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/Dockerfile1"}}},
}, {
Name: "build-2",
Params: []Param{{
Params: Params{{
Name: "IMAGE", Value: ParamValue{Type: ParamTypeString, StringVal: "image-2"},
}, {
Name: "DOCKERFILE", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/Dockerfile2"}}},
}, {
Name: "build-3",
Params: []Param{{
Params: Params{{
Name: "IMAGE", Value: ParamValue{Type: ParamTypeString, StringVal: "image-3"},
}, {
Name: "DOCKERFILE", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/Dockerfile3"}}},
Expand Down Expand Up @@ -321,7 +321,7 @@ func TestMatrix_FanOut(t *testing.T) {
},
Include: IncludeParamsList{{
Name: "s390x-no-race",
Params: []Param{{
Params: Params{{
Name: "GOARCH", Value: ParamValue{Type: ParamTypeString, StringVal: "linux/s390x"},
}, {
Name: "flags", Value: ParamValue{Type: ParamTypeString, StringVal: "-cover -v"}}},
Expand Down Expand Up @@ -474,23 +474,23 @@ func TestMatrix_FanOut(t *testing.T) {
},
Include: IncludeParamsList{{
Name: "common-package",
Params: []Param{{
Params: Params{{
Name: "package", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/common/package/"}}},
}, {
Name: "s390x-no-race",
Params: []Param{{
Params: Params{{
Name: "GOARCH", Value: ParamValue{Type: ParamTypeString, StringVal: "linux/s390x"},
}, {
Name: "flags", Value: ParamValue{Type: ParamTypeString, StringVal: "-cover -v"}}},
}, {
Name: "go117-context",
Params: []Param{{
Params: Params{{
Name: "version", Value: ParamValue{Type: ParamTypeString, StringVal: "go1.17"},
}, {
Name: "context", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/go117/context"}}},
}, {
Name: "non-existent-arch",
Params: []Param{{
Params: Params{{
Name: "GOARCH", Value: ParamValue{Type: ParamTypeString, StringVal: "I-do-not-exist"}},
},
}},
Expand Down Expand Up @@ -610,15 +610,15 @@ func TestMatrix_HasParams(t *testing.T) {
{
name: "matrixed with params",
matrix: &Matrix{
Params: []Param{{Name: "platform", Value: ParamValue{ArrayVal: []string{"linux", "windows"}}}},
Params: Params{{Name: "platform", Value: ParamValue{ArrayVal: []string{"linux", "windows"}}}},
},
want: true,
}, {
name: "matrixed with include",
matrix: &Matrix{
Include: IncludeParamsList{{
Name: "build-1",
Params: []Param{{
Params: Params{{
Name: "IMAGE", Value: ParamValue{Type: ParamTypeString, StringVal: "image-1"},
}, {
Name: "DOCKERFILE", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/Dockerfile1"}}},
Expand Down Expand Up @@ -834,21 +834,21 @@ func TestPipelineTask_CountCombinations(t *testing.T) {
matrix: &Matrix{
Include: IncludeParamsList{{
Name: "build-1",
Params: []Param{{
Params: Params{{
Name: "IMAGE", Value: ParamValue{Type: ParamTypeString, StringVal: "image-1"},
}, {
Name: "DOCKERFILE", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/Dockerfile1"},
}},
}, {
Name: "build-2",
Params: []Param{{
Params: Params{{
Name: "IMAGE", Value: ParamValue{Type: ParamTypeString, StringVal: "image-2"},
}, {
Name: "DOCKERFILE", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/Dockerfile2"},
}},
}, {
Name: "build-3",
Params: []Param{{
Params: Params{{
Name: "IMAGE", Value: ParamValue{Type: ParamTypeString, StringVal: "image-3"},
}, {
Name: "DOCKERFILE", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/Dockerfile3"},
Expand All @@ -859,24 +859,24 @@ func TestPipelineTask_CountCombinations(t *testing.T) {
}, {
name: "params and include in matrix with overriding combinations params",
matrix: &Matrix{
Params: []Param{{
Params: Params{{
Name: "GOARCH", Value: ParamValue{ArrayVal: []string{"linux/amd64", "linux/ppc64le", "linux/s390x"}},
}, {
Name: "version", Value: ParamValue{ArrayVal: []string{"go1.17", "go1.18.1"}}},
},
Include: IncludeParamsList{{
Name: "common-package",
Params: []Param{{
Params: Params{{
Name: "package", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/common/package/"}}},
}, {
Name: "s390x-no-race",
Params: []Param{{
Params: Params{{
Name: "GOARCH", Value: ParamValue{Type: ParamTypeString, StringVal: "linux/s390x"},
}, {
Name: "flags", Value: ParamValue{Type: ParamTypeString, StringVal: "-cover -v"}}},
}, {
Name: "go117-context",
Params: []Param{{
Params: Params{{
Name: "version", Value: ParamValue{Type: ParamTypeString, StringVal: "go1.17"},
}, {
Name: "context", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/go117/context"}}},
Expand All @@ -886,30 +886,30 @@ func TestPipelineTask_CountCombinations(t *testing.T) {
}, {
name: "params and include in matrix with overriding combinations params and one new combination",
matrix: &Matrix{
Params: []Param{{
Params: Params{{
Name: "GOARCH", Value: ParamValue{ArrayVal: []string{"linux/amd64", "linux/ppc64le", "linux/s390x"}},
}, {
Name: "version", Value: ParamValue{ArrayVal: []string{"go1.17", "go1.18.1"}}},
},
Include: IncludeParamsList{{
Name: "common-package",
Params: []Param{{
Params: Params{{
Name: "package", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/common/package/"}}},
}, {
Name: "s390x-no-race",
Params: []Param{{
Params: Params{{
Name: "GOARCH", Value: ParamValue{Type: ParamTypeString, StringVal: "linux/s390x"},
}, {
Name: "flags", Value: ParamValue{Type: ParamTypeString, StringVal: "-cover -v"}}},
}, {
Name: "go117-context",
Params: []Param{{
Params: Params{{
Name: "version", Value: ParamValue{Type: ParamTypeString, StringVal: "go1.17"},
}, {
Name: "context", Value: ParamValue{Type: ParamTypeString, StringVal: "path/to/go117/context"}}},
}, {
Name: "non-existent-arch",
Params: []Param{{
Params: Params{{
Name: "GOARCH", Value: ParamValue{Type: ParamTypeString, StringVal: "I-do-not-exist"}},
}},
}},
Expand Down
Loading

0 comments on commit 54c0f84

Please sign in to comment.