From baba77b5dc8de3e29a627c70bac26fee835f4921 Mon Sep 17 00:00:00 2001 From: Yassin Kortam Date: Thu, 9 Jul 2026 20:57:39 +0300 Subject: [PATCH] Revert "fix(helm): truncate the helm.sh/chart label to 63 bytes" This reverts commit 4f7f706a63. Version hygiene belongs to the pipeline that mints chart versions, not to the chart. The build workflow now caps the version slug so litellm- fits the 63 byte label budget, which removes the overflow at the source rather than silently truncating a value operators use to identify the build. Drops the litellm.chart helper, restores the direct helm.sh/chart printf, and removes tests/chart_label_tests.yaml. Both chart suites stay green: helm unittest -f 'tests/*.yaml' helm/litellm # 20 passed helm unittest -f 'tests/*.yaml' helm/litellm-helm # 69 passed --- helm/litellm/templates/_helpers.tpl | 11 +---- helm/litellm/tests/chart_label_tests.yaml | 60 ----------------------- 2 files changed, 1 insertion(+), 70 deletions(-) delete mode 100644 helm/litellm/tests/chart_label_tests.yaml diff --git a/helm/litellm/templates/_helpers.tpl b/helm/litellm/templates/_helpers.tpl index 80ab3d1e96e..0d3a2551487 100644 --- a/helm/litellm/templates/_helpers.tpl +++ b/helm/litellm/templates/_helpers.tpl @@ -27,20 +27,11 @@ Common naming + label helpers shared by gateway, backend, and ui templates. {{- printf "%s-ui" (include "litellm.fullname" .) | trunc 63 | trimSuffix "-" -}} {{- end -}} -{{/* -Chart label. Kubernetes caps a label value at 63 bytes, and .Chart.Version is -unbounded: CI branch builds version charts as 0.0.0-branch--, which -overflows and makes the API server reject every labeled resource. -*/}} -{{- define "litellm.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - {{- define "litellm.commonLabels" -}} app.kubernetes.io/name: {{ include "litellm.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} -helm.sh/chart: {{ include "litellm.chart" . }} +helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" }} {{- end -}} {{/* diff --git a/helm/litellm/tests/chart_label_tests.yaml b/helm/litellm/tests/chart_label_tests.yaml deleted file mode 100644 index 7bd0a4b9b4e..00000000000 --- a/helm/litellm/tests/chart_label_tests.yaml +++ /dev/null @@ -1,60 +0,0 @@ -suite: test helm.sh/chart label stays within the 63 byte kubernetes limit -templates: - - gateway/deployment.yaml - - gateway/configmap.yaml - - backend/deployment.yaml - - ui/deployment.yaml - - migrations-job.yaml -values: - - ./values/required.yaml -tests: - - it: renders the plain chart label for a normal semver version - template: gateway/deployment.yaml - chart: - version: 0.1.0 - asserts: - - equal: - path: metadata.labels["helm.sh/chart"] - value: litellm-0.1.0 - - # CI publishes branch builds as 0.0.0-branch--. Untruncated, the - # label is 64 bytes and the API server rejects every labeled resource with - # "must be no more than 63 bytes", which wedges the whole release. - - it: truncates a long branch-build version to 63 bytes on the gateway - template: gateway/deployment.yaml - chart: - version: 0.0.0-branch-litellm-enterprise-request-metering-f0b217f - asserts: - - equal: - path: metadata.labels["helm.sh/chart"] - value: litellm-0.0.0-branch-litellm-enterprise-request-metering-f0b217 - - - it: truncates the long version on the migrations job that blocked the sync - template: migrations-job.yaml - chart: - version: 0.0.0-branch-litellm-enterprise-request-metering-f0b217f - asserts: - - equal: - path: metadata.labels["helm.sh/chart"] - value: litellm-0.0.0-branch-litellm-enterprise-request-metering-f0b217 - - - it: truncates the long version on backend and ui - templates: - - backend/deployment.yaml - - ui/deployment.yaml - chart: - version: 0.0.0-branch-litellm-enterprise-request-metering-f0b217f - asserts: - - equal: - path: metadata.labels["helm.sh/chart"] - value: litellm-0.0.0-branch-litellm-enterprise-request-metering-f0b217 - - # trunc can land on the separator; a label value may not end in a dash. - - it: never leaves a trailing dash after truncation - template: gateway/deployment.yaml - chart: - version: 0.0.0-branch-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-bbb - asserts: - - matchRegex: - path: metadata.labels["helm.sh/chart"] - pattern: "[^-]$"