1

When we perform Tekton trigger API using an eventlistener, I am getting following response while in the background, pipeline runs for certain period of time.

Is there any API to fetch the status of this pipelineRun using the given eventID or eventListenerUID?

{
  "eventListener": "listener",
  "namespace": "default",
  "eventListenerUID": "ea71a6e4-9531-43a1-94fe-6136515d938c",
  "eventID": "14a657c3-6816-45bf-b214-4afdaefc4ebd"
}

Ref - https://github.com/tektoncd/triggers/blob/main/docs/eventlisteners.md#labels-in-eventListeners

Mahesh
  • 1,117
  • 2
  • 23
  • 42

1 Answers1

1

You can use that eventID resolving your pipelinerun:

kubectl -n <your-namespace> get pr -l triggers.tekton.dev/tekton-eventid=<your-event-id>

Then, extract the status column, or use jsonpath to access status.conditions[0].type.

SYN
  • 4,476
  • 1
  • 20
  • 22
  • Yeah got it, but i wanted an api but unfortunately kubectl presence is not applied to my environment so that i could call via python subprocess. But anyways, i found an alternative directly via tekton api. – Mahesh Oct 17 '22 at 06:58