Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly annotate TaskRuns with release version. #4424

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

mattmoor
Copy link
Member

@mattmoor mattmoor commented Dec 14, 2021

Previously we were expecting TaskRuns to be decorated with an annotation specifying
the release version of the tekton controller, however, the place that was populating
these annotations was extremely subtle and fragile. The annotation was set as part
of synthesizing the Pod to create where the Pod's annotations were based on the
TaskRun's.

This contains two main changes:

  1. Explicitly copy the TaskRun's annotations when populating the pod's annotations
    to eliminate this implicit and fragile back-propagation of annotations.

  2. Add an explicit decoration of the annotation, which is less fragile and executed
    regardless of whether the Pod is being created during this reconciliation pass.

Fixes: #4421

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Docs included if any changes are user facing
  • Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been filled in or deleted (only if no user facing changes)

Release Notes

More consistently apply the pipeline.tekton.dev/release annotation to TaskRun resources.

@tekton-robot tekton-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Dec 14, 2021
@tekton-robot tekton-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 14, 2021
Previously we were expecting TaskRuns to be decorated with an annotation specifying
the release version of the tekton controller, however, the place that was populating
these annotations was extremely subtle and fragile.  The annotation was set as part
of synthesizing the `Pod` to create where the Pod's annotations were based on the
`TaskRun`'s.

This contains two main changes:
1. Explicitly copy the `TaskRun`'s annotations when populating the pod's annotations
  to eliminate this implicit and fragile back-propagation of annotations.

2. Add an explicit decoration of the annotation, which is less fragile and executed
  regardless of whether the Pod is being created during this reconciliation pass.

Fixes: tektoncd#4421
@tekton-robot tekton-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 14, 2021
@mattmoor mattmoor changed the title [WIP] Copy the taskRun.Annotations before alterring them. Explicitly annotate TaskRuns with release version. Dec 14, 2021
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 14, 2021
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/taskrun/taskrun.go 79.9% 80.0% 0.1

@mattmoor
Copy link
Member Author

/test check-pr-has-kind-label

@mattmoor
Copy link
Member Author

Hmm, looks unrelated:

examples_test.go:62: Failed waiting for task run done: timed out waiting for the condition

/retest

@mattmoor
Copy link
Member Author

More timeouts, but in unrelated tests...

/retest

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dlorenc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 14, 2021
@imjasonh
Copy link
Member

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 14, 2021
@tekton-robot tekton-robot merged commit 2bcd297 into tektoncd:main Dec 14, 2021
@mattmoor mattmoor deleted the release-annotation branch December 14, 2021 19:05
concaf added a commit to concaf/pipeline that referenced this pull request Sep 7, 2022
concaf added a commit to openshift/tektoncd-pipeline that referenced this pull request Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestTaskRunFailure is flaky
4 participants