tektoncd / triggers

Event triggering with Tekton!
Apache License 2.0
546 stars 416 forks source link

flaky presence of tekton-generated labels in pipelineRun and taskRun 'Started' cloud events #1680

Open gerrnot opened 7 months ago

gerrnot commented 7 months ago

Expected Behavior

As indicated in https://tekton.dev/docs/pipelines/events/, tekton emitted cloud events should always contain tekton-generated k8s labels, e.g.:

Note: Those are just examples, I would really wish to have all labels already present!

Actual Behavior

It seems to depend on some timing (random), whether the labels are already present or not (for all 'Started' cloud events)

Steps to Reproduce the Problem

  1. Set kubens to tekton-pipelines (Or if using a different ns, also use a different ns below!)
  2. Configure your cloud event sink to point to the EventListener Service that will be created in the next step (e.g. http://el-flaky-labels.tekton-pipelines:8080)
  3. Run chmod +x test.sh; test.sh (after extracting the reproduce.zip)
  4. The resulting count of PipelineRuns for the Pipeline "flaky-labels-triggered-manually" will be 10 as performed by the script. However, the resulting count of PipelineRuns for the Pipeline "flaky-labels-triggered-if-labels-present" will be something like 3, indicating the success rate of "label-presence". If the defect is fixed, it should be 10 as well!

Additional Info