Skip to content

fix(tektonchain): sync leader-election configmap - #3810

Open
pujitha24 wants to merge 1 commit into
tektoncd:mainfrom
pujitha24:auto/issue-2884
Open

fix(tektonchain): sync leader-election configmap#3810
pujitha24 wants to merge 1 commit into
tektoncd:mainfrom
pujitha24:auto/issue-2884

Conversation

@pujitha24

Copy link
Copy Markdown

Motivation:
TektonConfig.spec.chain.performance values (e.g. buckets) were
correctly propagated to the tekton-chains-controller Deployment's
pod labels and container args, but the ConfigMap
tekton-chains-config-leader-election was never updated to match,
so it kept stale/default data instead of reflecting the current
TektonConfig. This is a data-consistency bug in that ConfigMap,
not a functional HA failure: the controller itself already
receives the tuned values via the Deployment's args and pod
labels, which are unaffected by this fix.

Approach:
tektonpipeline and tektonresult already call
common.AddConfigMapValues(, ...
Performance.PerformanceLeaderElectionConfig) alongside
common.UpdatePerformanceFlagsInDeploymentAndLeaderConfigMap to
keep their leader-election ConfigMaps in sync. The tektonchain
transformer chain was missing that call. Add it, mirroring the
existing pipeline/result behavior.

Validation:
Added TestUpdateLeaderElectionConfigMapForChains to
pkg/reconciler/kubernetes/tektonchain/transform_test.go, with a
new minimal fixture testdata/test-chain-leader-election-configmap.yaml.
Confirmed (by temporarily reverting transform.go) that this test
fails without the fix and passes with it.

go build ./...
go test ./pkg/reconciler/kubernetes/tektonchain/... ./pkg/reconciler/common/...

Both commands pass. golangci-lint could not be downloaded in this
sandbox (checksum mismatch fetching the pinned release binary,
unrelated to this change); go vet and go build are clean.

Fixes #2884

Fix `tekton-chains-config-leader-election` ConfigMap not being
updated with `TektonConfig.spec.chain.performance` values.

Signed-off-by: Pujitha Paladugu 10557236+pujitha24@users.noreply.github.com


AI assistance: this change was drafted with Claude Code.

Motivation:
TektonConfig.spec.chain.performance values (e.g. buckets) were
correctly propagated to the tekton-chains-controller Deployment's
pod labels and container args, but the ConfigMap
tekton-chains-config-leader-election was never updated to match,
so it kept stale/default data instead of reflecting the current
TektonConfig. This is a data-consistency bug in that ConfigMap,
not a functional HA failure: the controller itself already
receives the tuned values via the Deployment's args and pod
labels, which are unaffected by this fix.

Approach:
tektonpipeline and tektonresult already call
common.AddConfigMapValues(<leaderElectionConfigMapName>, ...
Performance.PerformanceLeaderElectionConfig) alongside
common.UpdatePerformanceFlagsInDeploymentAndLeaderConfigMap to
keep their leader-election ConfigMaps in sync. The tektonchain
transformer chain was missing that call. Add it, mirroring the
existing pipeline/result behavior.

Validation:
Added TestUpdateLeaderElectionConfigMapForChains to
pkg/reconciler/kubernetes/tektonchain/transform_test.go, with a
new minimal fixture testdata/test-chain-leader-election-configmap.yaml.
Confirmed (by temporarily reverting transform.go) that this test
fails without the fix and passes with it.

  go build ./...
  go test ./pkg/reconciler/kubernetes/tektonchain/... ./pkg/reconciler/common/...

Both commands pass. golangci-lint could not be downloaded in this
sandbox (checksum mismatch fetching the pinned release binary,
unrelated to this change); go vet and go build are clean.

Fixes tektoncd#2884

```release-note
Fix `tekton-chains-config-leader-election` ConfigMap not being
updated with `TektonConfig.spec.chain.performance` values.
```

Signed-off-by: Pujitha Paladugu <10557236+pujitha24@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 27, 2026 02:07
@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jul 27, 2026
@tekton-robot

Copy link
Copy Markdown
Contributor

[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.

Details 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

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 27, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: pujitha24 / name: Pujitha Paladugu (8c45120)

@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a data-consistency gap in the Tekton Chains Kubernetes reconciler by ensuring the tekton-chains-config-leader-election ConfigMap is updated when TektonChain performance (leader election) settings change—matching the existing behavior in other components (e.g., pipeline/results).

Changes:

  • Add common.AddConfigMapValues(...) for the chains leader-election ConfigMap so performance leader-election fields (e.g., buckets) are written into the ConfigMap during manifest transformation.
  • Add a focused unit test validating the leader-election ConfigMap is updated based on the CR’s performance settings.
  • Introduce a minimal manifest fixture containing the chains controller Deployment and the leader-election ConfigMap for the new test.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pkg/reconciler/kubernetes/tektonchain/transform.go Adds configmap-value injection for the chains leader-election ConfigMap to keep it in sync with performance settings.
pkg/reconciler/kubernetes/tektonchain/transform_test.go Adds a unit test asserting buckets is updated in the leader-election ConfigMap after transformation.
pkg/reconciler/common/testdata/test-chain-leader-election-configmap.yaml Adds a minimal Deployment+ConfigMap fixture used by the new unit test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter

codecov-commenter commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.40%. Comparing base (5a94d1b) to head (8c45120).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3810   +/-   ##
=======================================
  Coverage   25.40%   25.40%           
=======================================
  Files         449      449           
  Lines       23477    23478    +1     
=======================================
+ Hits         5964     5965    +1     
  Misses      16822    16822           
  Partials      691      691           
Flag Coverage Δ
unit-tests 25.40% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jkhelil

jkhelil commented Jul 27, 2026

Copy link
Copy Markdown
Member

hi @pujitha24 Can you go through easycla ?

@pujitha24

Copy link
Copy Markdown
Author

/easycla

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tekton Chains ConfigMap tekton-chains-config-leader-election not Updated with TektonConfig Performance Values

5 participants