Skip to content

PVC auto-cleanup annotation propagates to child PipelineRuns in Pipeline-in-Pipeline #9679

@waveywaves

Description

@waveywaves

Expected Behavior

When a user sets the tekton.dev/auto-cleanup-pvc annotation on a parent PipelineRun, only the parent PipelineRun's VolumeClaimTemplate PVCs should be cleaned up after completion. Child PipelineRuns created via Pipeline-in-Pipeline should not inherit this annotation.

Actual Behavior

The tekton.dev/auto-cleanup-pvc annotation propagates to child PipelineRuns through createChildResourceAnnotations in pkg/reconciler/pipelinerun/pipelinerun.go. This function only filters out chains.tekton.dev/* annotations, allowing all other annotations (including tekton.dev/auto-cleanup-pvc) to propagate to child PipelineRuns.

This causes child PipelineRun VolumeClaimTemplate PVCs to also be auto-deleted on completion — unexpected behavior for users who only intended parent PVC cleanup.

Steps to Reproduce the Problem

  1. Create a Pipeline that uses Pipeline-in-Pipeline (alpha feature)
  2. Create a PipelineRun with tekton.dev/auto-cleanup-pvc: "true" annotation
  3. Both parent and child PipelineRuns create VolumeClaimTemplate PVCs
  4. On completion, child PipelineRun PVCs are also deleted (unexpected)

Additional Info

  • Found during review of PR feat: add optional PVC auto-cleanup annotation for workspaces mode #9354 (feat: add optional PVC auto-cleanup annotation for workspaces mode)
  • The createChildResourceAnnotations function filters only chains.tekton.dev/* — should also filter tekton.dev/auto-cleanup-pvc
  • Pipeline-in-Pipeline is an alpha feature, so blast radius is limited
  • Fix: add tekton.dev/auto-cleanup-pvc to the annotation filter list in createChildResourceAnnotations

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions