fix(chart): stamp CRD labels with chart appVersion instead of hardcoded devel - #3940
fix(chart): stamp CRD labels with chart appVersion instead of hardcoded devel#3940aqeelat wants to merge 1 commit into
Conversation
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 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/assign @anithapriyanatarajan |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: waveywaves The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/lgtm |
Changes
The OCI-published chart (e.g.
ghcr.io/tektoncd/operator/charts/tekton-operator:0.81.0) ships CRDs with labelsversion: "devel"andoperator.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 showsrelease: develwhile everything else says the real version — misleading for auditing.Root cause:
hack/sync-helm-crds.sh(which generatescharts/tekton-operator/templates/{kubernetes,openshift}-crds.yaml) injects hardcoded"devel"labels, and the release workflow (.github/workflows/helm-release.yaml) stamps onlyChart.yaml— the CRD templates are never touched.Fix: the label injection now emits
{{ .Chart.AppVersion | quote }}. In-tree/dev renders keepdevel(Chart.yamlappVersion: "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):
"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
make test lintbefore submitting a PR (chart-only change;lint-go0 issues,yamllintclean on changed files.helm lintfails on main pre-existing —version: "devel"is not valid semver)helm templaterenders above)Release Notes