Skip to content

fix(chart): stamp CRD labels with chart appVersion instead of hardcoded devel - #3940

Open
aqeelat wants to merge 1 commit into
tektoncd:mainfrom
aqeelat:chart/crd-release-labels
Open

fix(chart): stamp CRD labels with chart appVersion instead of hardcoded devel#3940
aqeelat wants to merge 1 commit into
tektoncd:mainfrom
aqeelat:chart/crd-release-labels

Conversation

@aqeelat

@aqeelat aqeelat commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Changes

The OCI-published chart (e.g. ghcr.io/tektoncd/operator/charts/tekton-operator:0.81.0) ships CRDs with labels version: "devel" and operator.tekton.dev/release: "devel" even though the chart itself is correctly stamped (version: 0.81.0, appVersion: v0.81.0) and all deployment images pin :v0.81.0. For GitOps users (ArgoCD), every CRD diff shows release: devel while everything else says the real version — misleading for auditing.

Root cause: hack/sync-helm-crds.sh (which generates charts/tekton-operator/templates/{kubernetes,openshift}-crds.yaml) injects hardcoded "devel" labels, and the release workflow (.github/workflows/helm-release.yaml) stamps only Chart.yaml — the CRD templates are never touched.

Fix: the label injection now emits {{ .Chart.AppVersion | quote }}. In-tree/dev renders keep devel (Chart.yaml appVersion: "devel"), released OCI charts stamp the real version. No workflow change needed.

These labels are inert metadata: the operator reads operator.tekton.dev/release-version (a different key) on InstallerSets; nothing selects on these CRD labels.

Render proof (13 CRDs per platform, both kubernetes and openshift sets):

Chart.yaml appVersion Rendered CRD label
"devel" (in-tree) operator.tekton.dev/release: "devel"
"v0.82.0" (release-stamped) operator.tekton.dev/release: "v0.82.0"

Note: 0.81.0 is already published and stays as-is; this lands in the next release (maintainers may cherry-pick).

Submitter Checklist

  • Run make test lint before submitting a PR (chart-only change; lint-go 0 issues, yamllint clean on changed files. helm lint fails on main pre-existing — version: "devel" is not valid semver)
  • Includes tests (chart templates — verified via helm template renders above)
  • Includes docs (no user-facing behavior change beyond label values)
  • Commit messages follow commit message best practices

Release Notes

Helm chart: CRDs now carry the chart appVersion in their `version` / `operator.tekton.dev/release` labels instead of the hardcoded `devel`, so released charts show the actual release version.

The Helm chart CRD templates hardcoded version: "devel" and
operator.tekton.dev/release: "devel" on every CRD. Released OCI
charts are stamped only via Chart.yaml (version/appVersion), so
published charts shipped CRDs labeled "devel" while everything
else (chart metadata, deployment images) carried the real
release version — misleading for GitOps auditing (e.g. ArgoCD
diffs).

Use {{ .Chart.AppVersion | quote }} in the labels injected by
hack/sync-helm-crds.sh so in-tree renders keep "devel" and
released charts stamp the actual version. These labels are
inert metadata: the operator reads
operator.tekton.dev/release-version (a different key) on
InstallerSets, nothing selects on these CRD labels.

Signed-off-by: Abdullah Alaqeel <abdullah.t.aqeel@gmail.com>
@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Aug 17, 2026
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 17, 2026
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 26.33%. Comparing base (332b6f7) to head (20264d9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3940   +/-   ##
=======================================
  Coverage   26.33%   26.33%           
=======================================
  Files         465      465           
  Lines       24951    24951           
=======================================
  Hits         6572     6572           
  Misses      17661    17661           
  Partials      718      718           
Flag Coverage Δ
unit-tests 26.33% <ø> (ø)

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.

@aqeelat

aqeelat commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

/assign @anithapriyanatarajan

@tekton-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: waveywaves
To complete the pull request process, please ask for approval from anithapriyanatarajan after the PR has been reviewed.

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

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.

4 participants