Skip to content

Commit

Permalink
Fix bundle conversion for pipelineRef
Browse files Browse the repository at this point in the history
This commit fixes the bundle conversion for PipelineRef which should
be converting to the bundle Resolver with a Pipeline kind. It also adds
the conversion integration tests for the bundle logics to prevent such
error. It extracts the setup for bundle and makes it into a helper function.
  • Loading branch information
JeromeJu committed Jun 9, 2023
1 parent 89c2789 commit 9aceb06
Show file tree
Hide file tree
Showing 4 changed files with 1,320 additions and 120 deletions.
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1beta1/pipelineref_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (pr PipelineRef) convertBundleToResolver(sink *v1.PipelineRef) {
Value: v1.ParamValue{StringVal: pr.Name, Type: v1.ParamTypeString},
}, {
Name: "kind",
Value: v1.ParamValue{StringVal: "Task", Type: v1.ParamTypeString},
Value: v1.ParamValue{StringVal: "Pipeline", Type: v1.ParamTypeString},
}},
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/pipeline/v1beta1/pipelinerun_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func TestPipelineRunConversionFromDeprecated(t *testing.T) {
Params: []v1beta1.Param{
{Name: "bundle", Value: v1beta1.ParamValue{StringVal: "test-bundle", Type: "string"}},
{Name: "name", Value: v1beta1.ParamValue{StringVal: "test-bundle-name", Type: "string"}},
{Name: "kind", Value: v1beta1.ParamValue{StringVal: "Task", Type: "string"}},
{Name: "kind", Value: v1beta1.ParamValue{StringVal: "Pipeline", Type: "string"}},
},
},
},
Expand Down
Loading

0 comments on commit 9aceb06

Please sign in to comment.