From b4b30e65d1ada8c8990069a8f1f9168191b8439d Mon Sep 17 00:00:00 2001 From: fishu Date: Fri, 6 Mar 2020 18:02:06 +0800 Subject: [PATCH 1/2] ignore empty config --- pkg/resources/configmaps/configmap.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/resources/configmaps/configmap.go b/pkg/resources/configmaps/configmap.go index 7b7c58eee..42fd2376d 100644 --- a/pkg/resources/configmaps/configmap.go +++ b/pkg/resources/configmaps/configmap.go @@ -82,7 +82,11 @@ func generateRedisConfContent(configMap map[string]string) string { sort.Strings(keys) for _, k := range keys { - buffer.WriteString(fmt.Sprintf("%s %s", k, configMap[k])) + v := configMap[k] + if len(v) == 0 { + continue + } + buffer.WriteString(fmt.Sprintf("%s %s", k, v)) buffer.WriteString("\n") } From 8e02db403cddc40173d513eb19fd64000fe2f681 Mon Sep 17 00:00:00 2001 From: fishu Date: Fri, 6 Mar 2020 18:03:45 +0800 Subject: [PATCH 2/2] ignore empty config --- pkg/resources/configmaps/configmap_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/resources/configmaps/configmap_test.go b/pkg/resources/configmaps/configmap_test.go index c040c05aa..404c50a76 100644 --- a/pkg/resources/configmaps/configmap_test.go +++ b/pkg/resources/configmaps/configmap_test.go @@ -48,7 +48,6 @@ maxmemory 1000000000 maxmemory-policy noeviction maxmemory-samples 5 no-appendfsync-on-rewrite no -notify-keyspace-events repl-backlog-size 1048576 repl-backlog-ttl 3600 set-max-intset-entries 512