Skip to content

Conversation

enarha
Copy link

@enarha enarha commented Sep 3, 2025

Originally using Merge Patch + resourceVersion to manage finalizers leads to many retries when multiple controllers are managing the same type of object. The issue is especially apparent for PipelineRuns and TaskRuns. Using Server-Side Apply (SSA) patch eliminates that problem as well as other issues where one controller overrides another controller field.
When using SSA patch it's mandatory to provide fieldManager indicating which controller/client is managing a particular field. To communicate that from a controller, we leverage the Knative controller AgentName option. So far none of the Tekton controllers is using that, so we can use it as an indicator of intention to use an SSA patch to manage the finalizer. When a controller does not set AgentName, we keep the original behavior. This allows seamless transition for all controllers at their own time.

Changes

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

/kind feature

Release Notes

NONE

Originally using Merge Patch + resourceVersion to manage finalizers
leads to many retries when multiple controllers are managing the same
type of object. The issue is especially apparent for PipelineRuns and
TaskRuns. Using Server-Side Apply (SSA) patch eliminates that problem as
well as other issues where one controller overrides another controller
field.
When using SSA patch it's mandatory to provide fieldManager indicating
which controller/client is managing a particular field. To communicate
that from a controller, we leverage the Knative controller AgentName option.
So far none of the Tekton controllers is using that, so we can use it as
an indicator of intention to use an SSA patch to manage the finalizer. When
a controller does not set AgentName, we keep the original behavior. This
allows seamless transition for all controllers at their own time.
@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/feature Categorizes issue or PR as related to a new feature. labels Sep 3, 2025
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign vdemeester after the PR has been reviewed.
You can assign the PR to them by writing /assign @vdemeester in a comment when ready.

The full list of commands accepted by this bot can be found 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 size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 3, 2025
@waveywaves
Copy link
Member

Will have to close this PR for now as this change needs to be in the knative package first and then once it's updated there, we will be able to use that feature in tekton.
@enarha could you create an issue and link it here in the meanwhile ? I will close the issue after.

@waveywaves
Copy link
Member

I had added the above comment from my phone so didn't end up seeing the PR mentioned in the issue @enarha my bad

@waveywaves
Copy link
Member

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/feature Categorizes issue or PR as related to a new feature. release-note-none Denotes a PR that doesnt merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants