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 tektoncd#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 committed Mar 29, 2023
1 parent 9ff6034 commit 7980732
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 @@ -713,8 +713,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 @@ -1071,8 +1071,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 @@ -1591,9 +1591,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 @@ -1811,7 +1808,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 @@ -2136,8 +2133,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 @@ -3157,8 +3154,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 @@ -4634,8 +4631,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 @@ -4820,8 +4817,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 @@ -5945,8 +5942,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 @@ -6470,8 +6467,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 @@ -7120,8 +7117,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 @@ -7470,8 +7467,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 @@ -7855,8 +7852,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 @@ -8343,8 +8340,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 @@ -8708,7 +8705,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 @@ -8912,7 +8909,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 @@ -9277,8 +9274,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 @@ -10319,8 +10316,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 @@ -12239,8 +12236,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 7980732

Please sign in to comment.