Skip to content

Support implicit workspace propagation from Pipeline to Tasks #45

@vdemeester

Description

@vdemeester

Problem

Tekton supports implicit workspace propagation — when a Pipeline defines workspaces, they are automatically available to embedded Tasks that declare a workspace with the same name, without explicit workspaces mapping in each pipeline task.

Currently chisel/mallet requires explicit workspace mapping for every task.

Tekton Spec

apiVersion: tekton.dev/v1
kind: PipelineRun
spec:
  workspaces:
  - name: shared-data
    emptyDir: {}
  pipelineSpec:
    workspaces:
    - name: shared-data
    tasks:
    - name: write
      taskSpec:
        workspaces:
        - name: shared-data  # Auto-bound, no explicit mapping needed
        steps:
        - name: write
          image: alpine
          script: echo hello > $(workspaces.shared-data.path)/file.txt

Upstream examples

  • propagating-workspaces.yaml
  • propagating-workspaces-in-pipelines.yaml

Implementation

When a pipeline task doesn't explicitly map workspaces, auto-bind any pipeline-level workspace whose name matches a workspace declared by the task.

Acceptance Criteria

  • Pipeline workspaces are auto-bound to tasks with matching workspace names
  • Explicit workspace mappings override implicit propagation
  • propagating-workspaces* upstream examples pass
  • Works with both chisel and mallet

Jira: SRVKP-11415 (sub-gap)
Parent tracking: #41

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions