From e703c510b3519a0e197add43655710eef97d7cd8 Mon Sep 17 00:00:00 2001 From: Jamie Wiebe Date: Wed, 23 Nov 2022 09:50:08 +0100 Subject: [PATCH 1/2] allow for arbitrary labels in chart --- charts/redisoperator/Chart.yaml | 2 +- charts/redisoperator/templates/_helpers.tpl | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/charts/redisoperator/Chart.yaml b/charts/redisoperator/Chart.yaml index f0326dd83..5dde623fa 100644 --- a/charts/redisoperator/Chart.yaml +++ b/charts/redisoperator/Chart.yaml @@ -4,7 +4,7 @@ appVersion: 1.2.2 apiVersion: v1 description: A Helm chart for the Spotahome Redis Operator name: redis-operator -version: 3.2.4 +version: 3.2.5 home: https://github.com/spotahome/redis-operator keywords: - "golang" diff --git a/charts/redisoperator/templates/_helpers.tpl b/charts/redisoperator/templates/_helpers.tpl index 49f113c09..180bcc4dd 100644 --- a/charts/redisoperator/templates/_helpers.tpl +++ b/charts/redisoperator/templates/_helpers.tpl @@ -45,6 +45,9 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: {{ include "chart.name" . }} +{{- range $k, $v := .Values.labels }} +{{ $k }}: {{ $v }} +{{- end }} {{- end -}} {{/* @@ -72,4 +75,4 @@ Create the name of the service account to use {{- with .Values.imageCredentials }} {{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} From 7ea8002b202af7422e2131dc3b4a2b9efc57a902 Mon Sep 17 00:00:00 2001 From: Jamie Wiebe Date: Wed, 23 Nov 2022 10:09:17 +0100 Subject: [PATCH 2/2] fix unit test --- operator/redisfailover/service/generator_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/operator/redisfailover/service/generator_test.go b/operator/redisfailover/service/generator_test.go index 7c7cc62dd..94779bcf0 100644 --- a/operator/redisfailover/service/generator_test.go +++ b/operator/redisfailover/service/generator_test.go @@ -1488,7 +1488,6 @@ func TestSentinelImagePullPolicy(t *testing.T) { } func TestRedisExtraVolumeMounts(t *testing.T) { - mode := int32(755) tests := []struct { name string @@ -1564,7 +1563,6 @@ func TestRedisExtraVolumeMounts(t *testing.T) { } func TestSentinelExtraVolumeMounts(t *testing.T) { - mode := int32(755) tests := []struct { name string @@ -1640,7 +1638,6 @@ func TestSentinelExtraVolumeMounts(t *testing.T) { } func TestCustomPort(t *testing.T) { - default_port := int32(6379) custom_port := int32(12345) tests := []struct { @@ -1696,7 +1693,6 @@ func TestCustomPort(t *testing.T) { } func TestRedisEnv(t *testing.T) { - default_port := int32(6379) tests := []struct { name string @@ -1709,7 +1705,7 @@ func TestRedisEnv(t *testing.T) { expectedRedisEnv: []corev1.EnvVar{ { Name: "REDIS_ADDR", - Value: fmt.Sprintf("redis://localhost:%[1]v", default_port), + Value: fmt.Sprintf("redis://127.0.0.1:%[1]v", default_port), }, { Name: "REDIS_PORT", @@ -1727,7 +1723,7 @@ func TestRedisEnv(t *testing.T) { expectedRedisEnv: []corev1.EnvVar{ { Name: "REDIS_ADDR", - Value: fmt.Sprintf("redis://localhost:%[1]v", default_port), + Value: fmt.Sprintf("redis://127.0.0.1:%[1]v", default_port), }, { Name: "REDIS_PORT",