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

Use targetURI for cloudEvent resource details #384

Merged
merged 1 commit into from
Oct 25, 2019
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/cmd/pipelineresource/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ func details(pre v1alpha1.PipelineResource) string {
var key = "url"
if pre.Spec.Type == v1alpha1.PipelineResourceTypeStorage {
key = "location"
} else if pre.Spec.Type == v1alpha1.PipelineResourceTypeCloudEvent {
key = "targeturi"
sthaha marked this conversation as resolved.
Show resolved Hide resolved
}

for _, p := range pre.Spec.Params {
Expand Down
17 changes: 12 additions & 5 deletions pkg/cmd/pipelineresource/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ func TestPipelineResourceList(t *testing.T) {
tb.PipelineResourceSpecParam("URL", "quey.io/tekton/webhook"),
),
),
tb.PipelineResource("test-5", "test-ns-1",
tb.PipelineResourceSpec("cloudEvent",
tb.PipelineResourceSpecParam("targetURI", "http://sink"),
),
),
}

tests := []struct {
Expand All @@ -64,11 +69,12 @@ func TestPipelineResourceList(t *testing.T) {
command: command(t, pres),
args: []string{"list", "-n", "test-ns-1"},
expected: []string{
"NAME TYPE DETAILS",
"test git url: [email protected]:tektoncd/cli-new.git",
"test-2 git url: [email protected]:tektoncd/cli.git",
"test-1 image URL: quey.io/tekton/controller",
"test-3 image ---",
"NAME TYPE DETAILS",
"test-5 cloudEvent targetURI: http://sink",
"test git url: [email protected]:tektoncd/cli-new.git",
"test-2 git url: [email protected]:tektoncd/cli.git",
"test-1 image URL: quey.io/tekton/controller",
"test-3 image ---",
"",
},
},
Expand Down Expand Up @@ -117,6 +123,7 @@ func TestPipelineResourceList(t *testing.T) {
command: command(t, pres),
args: []string{"list", "-n", "test-ns-1", "-o", "jsonpath={range .items[*]}{.metadata.name}{\"\\n\"}{end}"},
expected: []string{
"test-5",
"test",
"test-2",
"test-1",
Expand Down