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") } 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