From 430d8df284be392e454df933236771735b4bdb9c Mon Sep 17 00:00:00 2001 From: savitaashture Date: Tue, 3 Sep 2024 22:22:35 +0530 Subject: [PATCH] Bump Pipeline to v0.62.3 Bumping Pipeline to v0.62.3 to make client compatible with old pipeline versions Signed-off-by: Savita Ashture --- go.mod | 2 +- go.sum | 4 +- pkg/resources/create_test.go | 4 +- .../pkg/apis/pipeline/v1/artifact_types.go | 77 ++++++++++--------- .../pkg/apis/pipeline/v1/openapi_generated.go | 2 - .../pkg/apis/pipeline/v1/swagger.json | 2 - .../pkg/apis/pipeline/v1/taskrun_types.go | 2 +- .../apis/pipeline/v1/zz_generated.deepcopy.go | 6 +- vendor/modules.txt | 2 +- 9 files changed, 52 insertions(+), 49 deletions(-) diff --git a/go.mod b/go.mod index 9bdabaab7..8015cf590 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/sirupsen/logrus v1.9.3 github.com/spf13/cobra v1.7.0 - github.com/tektoncd/pipeline v0.62.1 + github.com/tektoncd/pipeline v0.62.3 github.com/tektoncd/plumbing v0.0.0-20221102182345-5dbcfda657d7 github.com/tidwall/sjson v1.2.4 go.opencensus.io v0.24.0 diff --git a/go.sum b/go.sum index c7bd5cbe9..3bfca9f6f 100644 --- a/go.sum +++ b/go.sum @@ -1045,8 +1045,8 @@ github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/tchap/go-patricia v2.2.6+incompatible/go.mod h1:bmLyhP68RS6kStMGxByiQ23RP/odRBOTVjwp2cDyi6I= -github.com/tektoncd/pipeline v0.62.1 h1:l+EvRCrLqTHuHwas+C4bRP6jzln8E1J9I7tnfwmWfJQ= -github.com/tektoncd/pipeline v0.62.1/go.mod h1:cYPH4n3X8t39arNMhgyU7swyv3hVeWToz1yYDRzTLT8= +github.com/tektoncd/pipeline v0.62.3 h1:hR6UKjwzChW+MNG41yjfTKiVW9xet8jbJS59tsIY7bc= +github.com/tektoncd/pipeline v0.62.3/go.mod h1:cYPH4n3X8t39arNMhgyU7swyv3hVeWToz1yYDRzTLT8= github.com/tektoncd/plumbing v0.0.0-20221102182345-5dbcfda657d7 h1:YsjQ83UBIIq4k/s2PzQ6pqe4tpPtm1hia3oyNBDDrDU= github.com/tektoncd/plumbing v0.0.0-20221102182345-5dbcfda657d7/go.mod h1:uJBaI0AL/kjPThiMYZcWRujEz7D401v643d6s/21GAg= github.com/tidwall/gjson v1.12.1 h1:ikuZsLdhr8Ws0IdROXUS1Gi4v9Z4pGqpX/CvJkxvfpo= diff --git a/pkg/resources/create_test.go b/pkg/resources/create_test.go index 3d8f28508..69b8b0549 100644 --- a/pkg/resources/create_test.go +++ b/pkg/resources/create_test.go @@ -142,7 +142,7 @@ func TestCreateResource(t *testing.T) { want pipelinev1.TaskRun }{{ name: "TaskRun without namespace", - json: json.RawMessage(`{"kind":"TaskRun","apiVersion":"tekton.dev/v1beta1","metadata":{"name":"my-taskrun","creationTimestamp":null,"labels":{"someLabel":"bar"}},"spec":{"serviceAccountName":"","taskRef":{"name":"my-task"}},"status":{"artifacts":{},"podName": ""}}`), + json: json.RawMessage(`{"kind":"TaskRun","apiVersion":"tekton.dev/v1beta1","metadata":{"name":"my-taskrun","creationTimestamp":null,"labels":{"someLabel":"bar"}},"spec":{"serviceAccountName":"","taskRef":{"name":"my-task"}},"status":{"podName": ""}}`), want: pipelinev1.TaskRun{ TypeMeta: metav1.TypeMeta{ APIVersion: "tekton.dev/v1beta1", @@ -168,7 +168,7 @@ func TestCreateResource(t *testing.T) { { name: "TaskRun with namespace", - json: json.RawMessage(`{"kind":"TaskRun","apiVersion":"tekton.dev/v1beta1","metadata":{"name":"my-taskrun","namespace":"bar","creationTimestamp":null,"labels":{"someLabel":"bar"}},"spec":{"serviceAccountName":"","taskRef":{"name":"my-task"}},"status":{"artifacts":{},"podName":""}}`), + json: json.RawMessage(`{"kind":"TaskRun","apiVersion":"tekton.dev/v1beta1","metadata":{"name":"my-taskrun","namespace":"bar","creationTimestamp":null,"labels":{"someLabel":"bar"}},"spec":{"serviceAccountName":"","taskRef":{"name":"my-task"}},"status":{"podName":""}}`), want: pipelinev1.TaskRun{ TypeMeta: metav1.TypeMeta{ APIVersion: "tekton.dev/v1beta1", diff --git a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/artifact_types.go b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/artifact_types.go index 21a0d8fc2..6281c3e1e 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/artifact_types.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/artifact_types.go @@ -52,29 +52,30 @@ type Artifacts struct { Outputs []Artifact `json:"outputs,omitempty"` } -func (a *Artifacts) Merge(another Artifacts) { +func (a *Artifacts) Merge(another *Artifacts) { inputMap := make(map[string][]ArtifactValue) var newInputs []Artifact for _, v := range a.Inputs { inputMap[v.Name] = v.Values } - - for _, v := range another.Inputs { - _, ok := inputMap[v.Name] - if !ok { - inputMap[v.Name] = []ArtifactValue{} - } - for _, vv := range v.Values { - exists := false - for _, av := range inputMap[v.Name] { - if cmp.Equal(vv, av) { - exists = true - break - } + if another != nil { + for _, v := range another.Inputs { + _, ok := inputMap[v.Name] + if !ok { + inputMap[v.Name] = []ArtifactValue{} } - if !exists { - inputMap[v.Name] = append(inputMap[v.Name], vv) + for _, vv := range v.Values { + exists := false + for _, av := range inputMap[v.Name] { + if cmp.Equal(vv, av) { + exists = true + break + } + } + if !exists { + inputMap[v.Name] = append(inputMap[v.Name], vv) + } } } } @@ -92,31 +93,33 @@ func (a *Artifacts) Merge(another Artifacts) { outputMap[v.Name] = v } - for _, v := range another.Outputs { - _, ok := outputMap[v.Name] - if !ok { - outputMap[v.Name] = Artifact{Name: v.Name, Values: []ArtifactValue{}, BuildOutput: v.BuildOutput} - } - // only update buildOutput to true. - // Do not convert to false if it was true before. - if v.BuildOutput { - art := outputMap[v.Name] - art.BuildOutput = v.BuildOutput - outputMap[v.Name] = art - } - for _, vv := range v.Values { - exists := false - for _, av := range outputMap[v.Name].Values { - if cmp.Equal(vv, av) { - exists = true - break - } + if another != nil { + for _, v := range another.Outputs { + _, ok := outputMap[v.Name] + if !ok { + outputMap[v.Name] = Artifact{Name: v.Name, Values: []ArtifactValue{}, BuildOutput: v.BuildOutput} } - if !exists { + // only update buildOutput to true. + // Do not convert to false if it was true before. + if v.BuildOutput { art := outputMap[v.Name] - art.Values = append(art.Values, vv) + art.BuildOutput = v.BuildOutput outputMap[v.Name] = art } + for _, vv := range v.Values { + exists := false + for _, av := range outputMap[v.Name].Values { + if cmp.Equal(vv, av) { + exists = true + break + } + } + if !exists { + art := outputMap[v.Name] + art.Values = append(art.Values, vv) + outputMap[v.Name] = art + } + } } } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/openapi_generated.go b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/openapi_generated.go index 42bf6748b..e2af39e17 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/openapi_generated.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/openapi_generated.go @@ -4214,7 +4214,6 @@ func schema_pkg_apis_pipeline_v1_TaskRunStatus(ref common.ReferenceCallback) com }, SchemaProps: spec.SchemaProps{ Description: "Artifacts are the list of artifacts written out by the task's containers", - Default: map[string]interface{}{}, Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Artifacts"), }, }, @@ -4366,7 +4365,6 @@ func schema_pkg_apis_pipeline_v1_TaskRunStatusFields(ref common.ReferenceCallbac }, SchemaProps: spec.SchemaProps{ Description: "Artifacts are the list of artifacts written out by the task's containers", - Default: map[string]interface{}{}, Ref: ref("github.com/tektoncd/pipeline/pkg/apis/pipeline/v1.Artifacts"), }, }, diff --git a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/swagger.json b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/swagger.json index 584220d0b..24715f858 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/swagger.json +++ b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/swagger.json @@ -2125,7 +2125,6 @@ }, "artifacts": { "description": "Artifacts are the list of artifacts written out by the task's containers", - "default": {}, "$ref": "#/definitions/v1.Artifacts", "x-kubernetes-list-type": "atomic" }, @@ -2220,7 +2219,6 @@ "properties": { "artifacts": { "description": "Artifacts are the list of artifacts written out by the task's containers", - "default": {}, "$ref": "#/definitions/v1.Artifacts", "x-kubernetes-list-type": "atomic" }, diff --git a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/taskrun_types.go b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/taskrun_types.go index ea6e51764..fb12b28c2 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/taskrun_types.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/taskrun_types.go @@ -282,7 +282,7 @@ type TaskRunStatusFields struct { // Artifacts are the list of artifacts written out by the task's containers // +optional // +listType=atomic - Artifacts Artifacts `json:"artifacts,omitempty"` + Artifacts *Artifacts `json:"artifacts,omitempty"` // The list has one entry per sidecar in the manifest. Each entry is // represents the imageid of the corresponding sidecar. diff --git a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/zz_generated.deepcopy.go b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/zz_generated.deepcopy.go index 12dbe03bf..c7e68b5c2 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/apis/pipeline/v1/zz_generated.deepcopy.go @@ -1934,7 +1934,11 @@ func (in *TaskRunStatusFields) DeepCopyInto(out *TaskRunStatusFields) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - in.Artifacts.DeepCopyInto(&out.Artifacts) + if in.Artifacts != nil { + in, out := &in.Artifacts, &out.Artifacts + *out = new(Artifacts) + (*in).DeepCopyInto(*out) + } if in.Sidecars != nil { in, out := &in.Sidecars, &out.Sidecars *out = make([]SidecarState, len(*in)) diff --git a/vendor/modules.txt b/vendor/modules.txt index 6ca886be3..04a50d1f1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -373,7 +373,7 @@ github.com/stoewer/go-strcase ## explicit; go 1.17 github.com/stretchr/testify/assert github.com/stretchr/testify/require -# github.com/tektoncd/pipeline v0.62.1 +# github.com/tektoncd/pipeline v0.62.3 ## explicit; go 1.22 github.com/tektoncd/pipeline/internal/artifactref github.com/tektoncd/pipeline/pkg/apis/config