From 1ae5d2b18e132a87033cbf34ae10b85b54c55a84 Mon Sep 17 00:00:00 2001 From: Tijmen Stor <23655598+tijmenstor@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:18:04 +0100 Subject: [PATCH] feat: GHA controller Helm Chart quoted labels (#3061) --- charts/gha-runner-scale-set-controller/templates/_helpers.tpl | 2 +- charts/gha-runner-scale-set-controller/tests/template_test.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/gha-runner-scale-set-controller/templates/_helpers.tpl b/charts/gha-runner-scale-set-controller/templates/_helpers.tpl index 8ac225a9..b4adbd00 100644 --- a/charts/gha-runner-scale-set-controller/templates/_helpers.tpl +++ b/charts/gha-runner-scale-set-controller/templates/_helpers.tpl @@ -48,7 +48,7 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} app.kubernetes.io/part-of: gha-rs-controller app.kubernetes.io/managed-by: {{ .Release.Service }} {{- range $k, $v := .Values.labels }} -{{ $k }}: {{ $v }} +{{ $k }}: {{ $v | quote }} {{- end }} {{- end }} diff --git a/charts/gha-runner-scale-set-controller/tests/template_test.go b/charts/gha-runner-scale-set-controller/tests/template_test.go index a2709b2b..d42c1d43 100644 --- a/charts/gha-runner-scale-set-controller/tests/template_test.go +++ b/charts/gha-runner-scale-set-controller/tests/template_test.go @@ -404,6 +404,8 @@ func TestTemplate_ControllerDeployment_Customize(t *testing.T) { SetValues: map[string]string{ "labels.foo": "bar", "labels.github": "actions", + "labels.team": "GitHub Team", + "labels.teamMail": "team@github.com", "replicaCount": "1", "image.pullPolicy": "Always", "image.tag": "dev", @@ -445,6 +447,8 @@ func TestTemplate_ControllerDeployment_Customize(t *testing.T) { assert.Equal(t, "gha-rs-controller", deployment.Labels["app.kubernetes.io/part-of"]) assert.Equal(t, "bar", deployment.Labels["foo"]) assert.Equal(t, "actions", deployment.Labels["github"]) + assert.Equal(t, "GitHub Team", deployment.Labels["team"]) + assert.Equal(t, "team@github.com", deployment.Labels["teamMail"]) assert.Equal(t, int32(1), *deployment.Spec.Replicas)