Skip to content

Annotations and Labels from Task are not propagated to the Pod #4477

@vdemeester

Description

@vdemeester

Expected Behavior

As documented here for labels (and it used to be the same for annotations), labels and annotations set on the Task should be propagated to the underlying Pod when run.

Actual Behavior

As of today, annotations and labels set on the Task are lost in translation and only labels and annotations from the TaskRun are passed to the generated Pod.

Steps to Reproduce the Problem

  1. Create a Task with an annotation and a label
  2. Create a TaskRun that reference it
  3. Look at the Pod associated with the TaskRun, it will not have the annotation nor the label set on the Task

Additional Info

  • Kubernetes version:

Any version

  • Tekton Pipeline version:

Current main and most likely since this PR, meaning since 0.25 or 0.26 ? 🤔


The main reason for this bug is that, because we are using the .Status.Spec to re-construct the Task definition and we are not storing annotation and labels in there, we are not using them when creating the Pod.

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