Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix copying description also during upgrade #2247

Merged
merged 1 commit into from
Mar 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions pkg/apis/pipeline/v1alpha1/pipeline_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func TestPipelineConversion(t *testing.T) {
Generation: 1,
},
Spec: PipelineSpec{
Description: "test",
Resources: []PipelineDeclaredResource{{
Name: "resource1",
Type: resource.PipelineResourceTypeGit,
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
}
1 change: 1 addition & 0 deletions pkg/apis/pipeline/v1alpha1/task_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func TestTaskConversion(t *testing.T) {
},
Spec: TaskSpec{
TaskSpec: v1beta1.TaskSpec{
Description: "test",
Steps: []v1beta1.Step{{Container: corev1.Container{
Image: "foo",
}}},
Expand Down