chore(runner): First cut on Tekton pipeline detection #2581
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds automatic detection and metadata collection for Tekton Pipelines CI/CD environment.
Changes
TEKTON_PIPELINErunner type to the protobuf schema/tekton/resultsdirectoryDetection Strategy
The Tekton runner detects execution environments by checking for the presence of Tekton's
/tekton/resultsdirectory, which is mounted in all TaskRun and PipelineRun containers. This approach works reliably for both standalone TaskRuns and tasks within Pipelines.Metadata Collection via Kubernetes Downward API
The runner collects Tekton execution metadata by reading pod labels from the Kubernetes Downward API mounted at
/etc/podinfo/labels. Users must configure the Downward API volume mount in their Task/Pipeline definitions:Tekton Labels Collected
The runner reads the following Tekton-specific labels from pod metadata:
PipelineRun context:
TaskRun context:
Namespace: Automatically read from /var/run/secrets/kubernetes.io/serviceaccount/namespace
Run URI Construction
The runner constructs dashboard URLs with priority: PipelineRun URL > TaskRun URL, defaulting to https://dashboard.tekton.dev. Users can customize the dashboard URL by setting the TEKTON_DASHBOARD_URL environment variable.
The runner works in minimal mode with just filesystem detection when Downward API is not configured. Pod labels are only collected when the volume mount is present, allowing basic runner detection without requiring template modifications.
Tackles issue #2545