From 3b2de40c55827950b30fa8a2e1661bf0efafcc5f Mon Sep 17 00:00:00 2001 From: Tristan Burgess Date: Tue, 14 Nov 2023 15:19:17 -0500 Subject: [PATCH 1/5] helm chart: align k8s version label with Values --- operations/helm/charts/grafana-agent/CHANGELOG.md | 5 +++++ operations/helm/charts/grafana-agent/Chart.yaml | 2 +- operations/helm/charts/grafana-agent/templates/_helpers.tpl | 4 +--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/operations/helm/charts/grafana-agent/CHANGELOG.md b/operations/helm/charts/grafana-agent/CHANGELOG.md index f87918d883ce..6b82c54edf9d 100644 --- a/operations/helm/charts/grafana-agent/CHANGELOG.md +++ b/operations/helm/charts/grafana-agent/CHANGELOG.md @@ -10,6 +10,11 @@ internal API changes are not present. Unreleased ---------- +### Enhancements + +- Ensure that `app.kubernetes.io/version` label accounts for any + image tag overrides supplied to the chart Values. (@tristanburgess) + 0.27.2 (2023-11-07) ---------- diff --git a/operations/helm/charts/grafana-agent/Chart.yaml b/operations/helm/charts/grafana-agent/Chart.yaml index d73883aeae7d..d1b983f7e2bd 100644 --- a/operations/helm/charts/grafana-agent/Chart.yaml +++ b/operations/helm/charts/grafana-agent/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: grafana-agent description: 'Grafana Agent' type: application -version: 0.27.2 +version: 0.27.3 appVersion: 'v0.37.4' dependencies: diff --git a/operations/helm/charts/grafana-agent/templates/_helpers.tpl b/operations/helm/charts/grafana-agent/templates/_helpers.tpl index b9336e976d62..d24f3915bc14 100644 --- a/operations/helm/charts/grafana-agent/templates/_helpers.tpl +++ b/operations/helm/charts/grafana-agent/templates/_helpers.tpl @@ -55,9 +55,7 @@ helm.sh/chart: {{ include "grafana-agent.chart" . }} app.kubernetes.io/version: "vX.Y.Z" app.kubernetes.io/managed-by: {{ .Release.Service }} {{- else }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} +app.kubernetes.io/version: {{ substr 1 -1 (include "grafana-agent.imageId" .) }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{- end }} From 999b7df88ee19fbdec303d1337a96282939109e0 Mon Sep 17 00:00:00 2001 From: Tristan Burgess Date: Tue, 14 Nov 2023 15:36:49 -0500 Subject: [PATCH 2/5] update docs --- operations/helm/charts/grafana-agent/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operations/helm/charts/grafana-agent/README.md b/operations/helm/charts/grafana-agent/README.md index f85c05a0b40b..7366c4bc6573 100644 --- a/operations/helm/charts/grafana-agent/README.md +++ b/operations/helm/charts/grafana-agent/README.md @@ -1,6 +1,6 @@ # Grafana Agent Helm chart -![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.27.2](https://img.shields.io/badge/Version-0.27.2-informational?style=flat-square) ![AppVersion: v0.37.4](https://img.shields.io/badge/AppVersion-v0.37.4-informational?style=flat-square) +![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.27.3](https://img.shields.io/badge/Version-0.27.3-informational?style=flat-square) ![AppVersion: v0.37.4](https://img.shields.io/badge/AppVersion-v0.37.4-informational?style=flat-square) Helm chart for deploying [Grafana Agent][] to Kubernetes. From f3c606698b6852e8d69ac0e6f7b46aef6c3d07e3 Mon Sep 17 00:00:00 2001 From: Tristan Burgess Date: Wed, 15 Nov 2023 08:09:16 -0500 Subject: [PATCH 3/5] revert unneeded chart version bump --- operations/helm/charts/grafana-agent/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operations/helm/charts/grafana-agent/Chart.yaml b/operations/helm/charts/grafana-agent/Chart.yaml index d1b983f7e2bd..d73883aeae7d 100644 --- a/operations/helm/charts/grafana-agent/Chart.yaml +++ b/operations/helm/charts/grafana-agent/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: grafana-agent description: 'Grafana Agent' type: application -version: 0.27.3 +version: 0.27.2 appVersion: 'v0.37.4' dependencies: From 81903809a019d597191ac06f13fed903e0570acd Mon Sep 17 00:00:00 2001 From: Tristan Burgess Date: Wed, 15 Nov 2023 08:37:40 -0500 Subject: [PATCH 4/5] add comment to denote substr purpose --- operations/helm/charts/grafana-agent/templates/_helpers.tpl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/operations/helm/charts/grafana-agent/templates/_helpers.tpl b/operations/helm/charts/grafana-agent/templates/_helpers.tpl index d24f3915bc14..342a330a8aa6 100644 --- a/operations/helm/charts/grafana-agent/templates/_helpers.tpl +++ b/operations/helm/charts/grafana-agent/templates/_helpers.tpl @@ -55,6 +55,8 @@ helm.sh/chart: {{ include "grafana-agent.chart" . }} app.kubernetes.io/version: "vX.Y.Z" app.kubernetes.io/managed-by: {{ .Release.Service }} {{- else }} +{{/* substr trims delimeter prefix char from grafana-agent.imageId output + e.g. ':' for tags and '@' for digests. */}} app.kubernetes.io/version: {{ substr 1 -1 (include "grafana-agent.imageId" .) }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} From cf33a56a9db0f63a1a165835e78bbeb203c2a2cc Mon Sep 17 00:00:00 2001 From: Tristan Burgess Date: Wed, 15 Nov 2023 08:38:31 -0500 Subject: [PATCH 5/5] update docs --- operations/helm/charts/grafana-agent/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operations/helm/charts/grafana-agent/README.md b/operations/helm/charts/grafana-agent/README.md index 7366c4bc6573..f85c05a0b40b 100644 --- a/operations/helm/charts/grafana-agent/README.md +++ b/operations/helm/charts/grafana-agent/README.md @@ -1,6 +1,6 @@ # Grafana Agent Helm chart -![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.27.3](https://img.shields.io/badge/Version-0.27.3-informational?style=flat-square) ![AppVersion: v0.37.4](https://img.shields.io/badge/AppVersion-v0.37.4-informational?style=flat-square) +![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![Version: 0.27.2](https://img.shields.io/badge/Version-0.27.2-informational?style=flat-square) ![AppVersion: v0.37.4](https://img.shields.io/badge/AppVersion-v0.37.4-informational?style=flat-square) Helm chart for deploying [Grafana Agent][] to Kubernetes.