Skip to content

Commit

Permalink
Fix copying description also during upgrade
Browse files Browse the repository at this point in the history
This will add copying the description also
while upgrading from v1alpha1 to v1beta1
for pipeline, task and clustertask

Related to tektoncd/cli#819
  • Loading branch information
piyush-garg committed Mar 19, 2020
1 parent 1fb9a82 commit 85f1008
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/apis/pipeline/v1alpha1/pipeline_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func (source *PipelineSpec) ConvertTo(ctx context.Context, sink *v1beta1.Pipelin
sink.Resources = source.Resources
sink.Params = source.Params
sink.Workspaces = source.Workspaces
sink.Description = source.Description
if len(source.Tasks) > 0 {
sink.Tasks = make([]v1beta1.PipelineTask, len(source.Tasks))
for i := range source.Tasks {
Expand Down Expand Up @@ -86,6 +87,7 @@ func (sink *PipelineSpec) ConvertFrom(ctx context.Context, source v1beta1.Pipeli
sink.Resources = source.Resources
sink.Params = source.Params
sink.Workspaces = source.Workspaces
sink.Description = source.Description
if len(source.Tasks) > 0 {
sink.Tasks = make([]PipelineTask, len(source.Tasks))
for i := range source.Tasks {
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/pipeline/v1alpha1/task_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func (source *TaskSpec) ConvertTo(ctx context.Context, sink *v1beta1.TaskSpec) e
sink.Results = source.Results
sink.Resources = source.Resources
sink.Params = source.Params
sink.Description = source.Description
if source.Inputs != nil {
if len(source.Inputs.Params) > 0 && len(source.Params) > 0 {
// This shouldn't happen as it shouldn't pass validation
Expand Down Expand Up @@ -120,5 +121,6 @@ func (sink *TaskSpec) ConvertFrom(ctx context.Context, source *v1beta1.TaskSpec)
sink.Results = source.Results
sink.Params = source.Params
sink.Resources = source.Resources
sink.Description = source.Description
return nil
}

0 comments on commit 85f1008

Please sign in to comment.