diff --git a/pkg/apis/pipeline/v1beta1/param_conversion.go b/pkg/apis/pipeline/v1beta1/param_conversion.go index 443c94ddde7..aab4ba82bdd 100644 --- a/pkg/apis/pipeline/v1beta1/param_conversion.go +++ b/pkg/apis/pipeline/v1beta1/param_conversion.go @@ -61,7 +61,8 @@ func (p Param) convertTo(ctx context.Context, sink *v1.Param) { sink.Value = newValue } -func (p *Param) convertFrom(ctx context.Context, source v1.Param) { +// ConvertFrom v1 Param is exported for reconciling the deprecated v1beta1 CustomRun +func (p *Param) ConvertFrom(ctx context.Context, source v1.Param) { p.Name = source.Name newValue := ParamValue{} newValue.convertFrom(ctx, source.Value) diff --git a/pkg/apis/pipeline/v1beta1/pipeline_conversion.go b/pkg/apis/pipeline/v1beta1/pipeline_conversion.go index 0c66a3bd13c..2176def6956 100644 --- a/pkg/apis/pipeline/v1beta1/pipeline_conversion.go +++ b/pkg/apis/pipeline/v1beta1/pipeline_conversion.go @@ -189,7 +189,7 @@ func (pt *PipelineTask) convertFrom(ctx context.Context, source v1.PipelineTask) pt.Description = source.Description if source.TaskRef != nil { newTaskRef := TaskRef{} - newTaskRef.convertFrom(ctx, *source.TaskRef) + newTaskRef.ConvertFrom(ctx, *source.TaskRef) pt.TaskRef = &newTaskRef } if source.TaskSpec != nil { @@ -211,7 +211,7 @@ func (pt *PipelineTask) convertFrom(ctx context.Context, source v1.PipelineTask) pt.Params = nil for _, p := range source.Params { new := Param{} - new.convertFrom(ctx, p) + new.ConvertFrom(ctx, p) pt.Params = append(pt.Params, new) } pt.Matrix = nil @@ -278,7 +278,7 @@ func (m *Matrix) convertTo(ctx context.Context, sink *v1.Matrix) { func (m *Matrix) convertFrom(ctx context.Context, source v1.Matrix) { for _, param := range source.Params { new := Param{} - new.convertFrom(ctx, param) + new.ConvertFrom(ctx, param) m.Params = append(m.Params, new) } @@ -286,7 +286,7 @@ func (m *Matrix) convertFrom(ctx context.Context, source v1.Matrix) { m.Include = append(m.Include, IncludeParams{Name: include.Name}) for _, p := range include.Params { new := Param{} - new.convertFrom(ctx, p) + new.ConvertFrom(ctx, p) m.Include[i].Params = append(m.Include[i].Params, new) } } diff --git a/pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go b/pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go index 68a475233f1..0830236c714 100644 --- a/pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go +++ b/pkg/apis/pipeline/v1beta1/pipelinerun_conversion.go @@ -121,7 +121,7 @@ func (prs *PipelineRunSpec) ConvertFrom(ctx context.Context, source *v1.Pipeline prs.Params = nil for _, p := range source.Params { new := Param{} - new.convertFrom(ctx, p) + new.ConvertFrom(ctx, p) prs.Params = append(prs.Params, new) } prs.ServiceAccountName = source.TaskRunTemplate.ServiceAccountName @@ -135,7 +135,7 @@ func (prs *PipelineRunSpec) ConvertFrom(ctx context.Context, source *v1.Pipeline prs.Workspaces = nil for _, w := range source.Workspaces { new := WorkspaceBinding{} - new.convertFrom(ctx, w) + new.ConvertFrom(ctx, w) prs.Workspaces = append(prs.Workspaces, new) } prs.TaskRunSpecs = nil diff --git a/pkg/apis/pipeline/v1beta1/resolver_conversion.go b/pkg/apis/pipeline/v1beta1/resolver_conversion.go index 18d3c07bb64..3f7acbb4d5b 100644 --- a/pkg/apis/pipeline/v1beta1/resolver_conversion.go +++ b/pkg/apis/pipeline/v1beta1/resolver_conversion.go @@ -21,7 +21,7 @@ func (rr *ResolverRef) convertFrom(ctx context.Context, source v1.ResolverRef) { rr.Params = nil for _, r := range source.Params { new := Param{} - new.convertFrom(ctx, r) + new.ConvertFrom(ctx, r) rr.Params = append(rr.Params, new) } } diff --git a/pkg/apis/pipeline/v1beta1/taskref_conversion.go b/pkg/apis/pipeline/v1beta1/taskref_conversion.go index 8c0ed4c2e02..0b566313753 100644 --- a/pkg/apis/pipeline/v1beta1/taskref_conversion.go +++ b/pkg/apis/pipeline/v1beta1/taskref_conversion.go @@ -18,7 +18,8 @@ func (tr TaskRef) convertTo(ctx context.Context, sink *v1.TaskRef) { tr.convertBundleToResolver(sink) } -func (tr *TaskRef) convertFrom(ctx context.Context, source v1.TaskRef) { +// ConvertFrom v1 TaskRef is exported for reconciling the deprecated v1beta1 CustomRun +func (tr *TaskRef) ConvertFrom(ctx context.Context, source v1.TaskRef) { tr.Name = source.Name tr.Kind = TaskKind(source.Kind) tr.APIVersion = source.APIVersion diff --git a/pkg/apis/pipeline/v1beta1/taskrun_conversion.go b/pkg/apis/pipeline/v1beta1/taskrun_conversion.go index 726448ab104..a8ca70eebf7 100644 --- a/pkg/apis/pipeline/v1beta1/taskrun_conversion.go +++ b/pkg/apis/pipeline/v1beta1/taskrun_conversion.go @@ -140,13 +140,13 @@ func (trs *TaskRunSpec) ConvertFrom(ctx context.Context, source *v1.TaskRunSpec) trs.Params = nil for _, p := range source.Params { new := Param{} - new.convertFrom(ctx, p) + new.ConvertFrom(ctx, p) trs.Params = append(trs.Params, new) } trs.ServiceAccountName = source.ServiceAccountName if source.TaskRef != nil { newTaskRef := TaskRef{} - newTaskRef.convertFrom(ctx, *source.TaskRef) + newTaskRef.ConvertFrom(ctx, *source.TaskRef) trs.TaskRef = &newTaskRef } if source.TaskSpec != nil { @@ -165,7 +165,7 @@ func (trs *TaskRunSpec) ConvertFrom(ctx context.Context, source *v1.TaskRunSpec) trs.Workspaces = nil for _, w := range source.Workspaces { new := WorkspaceBinding{} - new.convertFrom(ctx, w) + new.ConvertFrom(ctx, w) trs.Workspaces = append(trs.Workspaces, new) } trs.StepOverrides = nil diff --git a/pkg/apis/pipeline/v1beta1/workspace_conversion.go b/pkg/apis/pipeline/v1beta1/workspace_conversion.go index 727e8e6f3ad..dc713a37f37 100644 --- a/pkg/apis/pipeline/v1beta1/workspace_conversion.go +++ b/pkg/apis/pipeline/v1beta1/workspace_conversion.go @@ -68,7 +68,8 @@ func (w WorkspaceBinding) convertTo(ctx context.Context, sink *v1.WorkspaceBindi sink.CSI = w.CSI } -func (w *WorkspaceBinding) convertFrom(ctx context.Context, source v1.WorkspaceBinding) { +// ConvertFrom v1 WorkspaceBinding is exported for reconciling the deprecated v1beta1 CustomRun +func (w *WorkspaceBinding) ConvertFrom(ctx context.Context, source v1.WorkspaceBinding) { w.Name = source.Name w.SubPath = source.SubPath w.VolumeClaimTemplate = source.VolumeClaimTemplate