[feature] Conditions emit no events like other Tekton resources #2461
Closed
Description
Expected Behavior
Conditions shall emit k8s events like other resources
Actual Behavior
No events are emitted for conditions in any case
Steps to Reproduce the Problem
- Run a condition
kubectl describe taskrun/<tr-name>
Example:
$ k describe tr/tekton-yamllint-nf9c5-check-reset-9tx62-check-name-matche-xs7xt -n tektonci
Name: tekton-yamllint-nf9c5-check-reset-9tx62-check-name-matche-xs7xt
Namespace: tektonci
Labels: app.kubernetes.io/managed-by=tekton-pipelines
prow.k8s.io/build-id=85e12e80-83e8-11ea-874a-07e90178c9b9
tekton.dev/check-name=plumbing-yamllint
tekton.dev/conditionCheck=tekton-yamllint-nf9c5-check-reset-9tx62-check-name-matche-xs7xt
tekton.dev/kind=ci
tekton.dev/pipeline=tekton-yamllint
tekton.dev/pipelineRun=tekton-yamllint-nf9c5
tekton.dev/pipelineTask=check-reset
tekton.dev/pr-number=346
triggers.tekton.dev/eventlistener=tekton-ci-webhook
triggers.tekton.dev/trigger=pull-request-trigger
triggers.tekton.dev/triggers-eventid=224rq
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"tekton.dev/v1beta1","kind":"Pipeline","metadata":{"annotations":{},"name":"tekton-yamllint","namespace":"tektonci"},"spec":...
pipeline.tekton.dev/release: devel
tekton.dev/gitURL: https://github.com/tektoncd/plumbing
API Version: tekton.dev/v1beta1
Kind: TaskRun
Metadata:
Creation Timestamp: 2020-04-21T16:11:32Z
Generation: 1
Owner References:
API Version: tekton.dev/v1alpha1
Block Owner Deletion: true
Controller: true
Kind: PipelineRun
Name: tekton-yamllint-nf9c5
UID: f62c9507-7c52-40c9-a737-f85a949f2ade
Resource Version: 81050558
Self Link: /apis/tekton.dev/v1beta1/namespaces/tektonci/taskruns/tekton-yamllint-nf9c5-check-reset-9tx62-check-name-matche-xs7xt
UID: 2c1d19dc-1ed1-4d95-a887-af6a66b0fa07
Spec:
Params:
Name: gitHubCommand
Value:
Name: checkName
Value: plumbing-yamllint
Resources:
Service Account Name: tekton-ci-jobs
Task Spec:
Params:
Description: The whole comment left on GitHub
Name: gitHubCommand
Type: string
Description: The name of the check
Name: checkName
Type: string
Steps:
Image: alpine
Name: condition-check-check-name-matches
Resources:
Script: #!/bin/sh
set -ex
set -o pipefail
# TODO(afrittoli) We might want to move this to an external script so
# we can attach unit tests to it.
# If no command was specified, the check is successful
[[ "$(inputs.params.gitHubCommand)" == "" ]] && exit 0
# If a command was specified, the regex should match the checkName
REGEX="$(echo $(inputs.params.gitHubCommand) | awk '{ print $2}')"
[[ "$REGEX" == "" ]] && REGEX='.*'
echo "$(inputs.params.checkName)" | grep -E $REGEX
Timeout: 1h0m0s
Status:
Completion Time: 2020-04-21T16:11:53Z
Conditions:
Last Transition Time: 2020-04-21T16:11:53Z
Message: All Steps have completed executing
Reason: Succeeded
Status: True
Type: Succeeded
Pod Name: tekton-yamllint-nf9c5-check-reset-9tx62-check-name-matche-6qxds
Start Time: 2020-04-21T16:11:33Z
Steps:
Container: step-condition-check-check-name-matches
Image ID: docker-pullable://alpine@sha256:cb8a924afdf0229ef7515d9e5b3024e23b3eb03ddbba287f4a19c6ac90b8d221
Name: condition-check-check-name-matches
Terminated:
Container ID: docker://d9b07260ebf8c3c8330d5711749ccb992618d009e19934cedff979c2eac71b20
Exit Code: 0
Finished At: 2020-04-21T16:11:51Z
Reason: Completed
Started At: 2020-04-21T16:11:51Z
Events: <none>
Additional Info
-
Kubernetes version:
Output ofkubectl version
:
Server Version: version.Info{Major:"1", Minor:"15+", GitVersion:"v1.15.9-gke.24", GitCommit:"39e41a8d6b7221b901a95d3af358dea6994b4a40", GitTreeState:"clean", BuildDate:"2020-02-29T01:24:35Z", GoVersion:"go1.12.12b4", Compiler:"gc", Platform:"linux/amd64"} ```
-
Tekton Pipeline version:
Output of
tkn version
orkubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'
Client version: 0.8.0
Pipeline version: v0.11.1