Skip to content

Conversation

@waveywaves
Copy link
Member

Changes

Manual cherry pick of #9011

Submitter Checklist

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

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • pre-commit Passed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

Similar to issue tektoncd#8824 for PipelineRuns, the webhook was denying
finalizer updates on completed TaskRuns. The validation webhook was
blocking all updates when TaskRun.IsDone() returned true, preventing
tools like Tekton Chains from clearing finalizers.

To ensure we don't have old obj default drift, we are adding
a fast path check for spec equality and are normalizing the old spec
with current defaults before comparison. Then we allow updates when
only finalizers differ and reject spec changes.

This mirrors the fix applied to PipelineRun validation.
fixes issue tektoncd#8824 where webhook denied finalizer updates on completed
PipelineRuns. The validation webhook was blocking all updates when
PipelineRun.IsDone() returned true, preventing from
clearing finalizers

to make sure that we don't have old obj default drift we are adding
a fast path check for spec equality and are normalizing the old spec
with current defaults before comparison. Then we allow updates when
only finalizers differ and reject spec changes

Signed-off-by: Vibhav Bobade <vibhav.bobde@gmail.com>
@tekton-robot tekton-robot added the release-note-none Denotes a PR that doesnt merit a release note. label Sep 8, 2025
@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Sep 8, 2025
The TestPipelineRunTaskRunSpecTimeout_Validate test functions were incorrectly
included in the cherry-pick. These tests reference a 'Timeout' field in
PipelineTaskRunSpec that doesn't exist in either v1 or v1beta1 APIs.

Also added missing 'strings' import for the finalizer validation tests.
fix nakedret errors by explicitly returning errs instead of naked returns
replace t.Context() with context.Background() to fix govet errors (t.Context() requires Go 1.24 but the file targets Go 1.23)
@tekton-robot
Copy link
Collaborator

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

File Old Coverage New Coverage Delta
pkg/apis/pipeline/v1/pipelinerun_validation.go 93.8% 94.2% 0.4
pkg/apis/pipeline/v1/taskrun_validation.go 97.4% 96.9% -0.5
pkg/apis/pipeline/v1beta1/pipelinerun_validation.go 95.7% 96.7% 1.0
pkg/apis/pipeline/v1beta1/taskrun_validation.go 98.1% 96.9% -1.2

@waveywaves waveywaves added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 8, 2025
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

@waveywaves waveywaves added the lgtm Indicates that a PR is ready to be merged. label Sep 8, 2025
@tekton-robot tekton-robot merged commit 0215e67 into tektoncd:release-v1.0.x Sep 8, 2025
16 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Tekton Community Roadmap Sep 8, 2025
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. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesnt merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants