Skip to content

Show TaskRun logs from child PipelineRuns (Pipelines-in-Pipelines) #2886

@twoGiants

Description

@twoGiants

Feature request

tkn pipelinerun logs does not follow child PipelineRuns created by the Pipelines-in-Pipelines (PinP) feature. When a PipelineTask uses pipelineSpec or pipelineRef, the parent PipelineRun owns a child PipelineRun, not a TaskRun. tkn pipelinerun logs only discovers TaskRuns, so TaskRuns inside child PipelineRuns are invisible.

Inline pipelineSpec is already functional today, and tektoncd/pipeline#9432 adds pipelineRef support, making PinP a fully functional alpha feature (TEP-0056). In both cases, tkn cannot surface the child PipelineRun TaskRun logs.

Use case

Apply the following resources (enable-api-fields must be set to alpha):

apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
  name: parent-pipeline
spec:
  tasks:
    - name: call-child
      pipelineSpec:
        tasks:
          - name: greet
            taskSpec:
              steps:
                - name: echo
                  image: busybox
                  script: echo "Hello from child"
---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
  name: parent-run
spec:
  pipelineRef:
    name: parent-pipeline
kubectl apply -f example.yaml

Wait for it to complete, then try to view logs:

# Shows nothing. The parent has no TaskRuns, only a child PipelineRun.
$ tkn pipelinerun logs parent-run -f

# User must manually discover the child PipelineRun name.
$ kubectl get pipelineruns
NAME                    SUCCEEDED
parent-run              True
parent-run-call-child   True

# Then query the child separately to see its TaskRun logs.
$ tkn pipelinerun logs parent-run-call-child -f
[greet : echo] Hello from child

This applies recursively. Nested pipelines (parent, child, grandchild) require one manual command per level. The same issue affects pipelineRef-based PinP.

UI Example

tkn pipelinerun logs should recursively follow child PipelineRuns and show their TaskRun logs inline:

$ tkn pipelinerun logs parent-run -f
[call-child > greet : echo] Hello from child

The > notation indicates nesting: call-child > greet means task greet inside child PipelineRun call-child.

tkn pipelinerun describe should similarly surface child PipelineRuns in its output.

/kind feature

Metadata

Metadata

Assignees

Labels

good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions