Skip to content

TaskRuns may be orphaned by a PipelineRun  #2558

@afrittoli

Description

@afrittoli

Expected Behavior

The PipelineRun controller should always be aware of TaskRuns owned by a PipelineRun even when the PipelineRun status is stale (because of API issues).
Before using the PipelineRun status as a source of truth, we should check it against the list ot TaskRuns owned by the PipelineRun.

Actual Behavior

When TaskRuns are created during the reconcile cycle of a PipelineRun, they are added to the PipelineRun status which is then sync'ed back to etcd. The sync may fail whatever error condition - if that happens, the TaskRuns are partially "orphaned": the PipelineRun will be queued for reconcile when they change and they will be deleted when the PipelineRun is deleted, however the PipelineRun controller will not be aware that they exist at all, and it will create new duplicate TaskRuns.

This happens because ResolvePipelineRun relies on the PipelineRun status alone, via the getTaskRunName function.

Steps to Reproduce the Problem

  1. I would like to be able to reproduce this. It might be worth building a test case to reproduce this situation but it might be difficult. If we can disable specific API calls from functioning we could allow creating a taskrun while prevent updating a pipelinerun.

Additional Info

  • Tekton Pipeline version:

v0.12.0

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions