From cfa7d20bf66217f3dccf0b6bbe7da0d2ccdacddf Mon Sep 17 00:00:00 2001 From: Jorge Turrado Date: Thu, 17 Mar 2022 10:41:12 +0100 Subject: [PATCH] Replace - with _ like k8s does Signed-off-by: Jorge Turrado --- operator/redisfailover/service/generator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operator/redisfailover/service/generator.go b/operator/redisfailover/service/generator.go index 9beab34ef..4e5641fd9 100644 --- a/operator/redisfailover/service/generator.go +++ b/operator/redisfailover/service/generator.go @@ -162,7 +162,7 @@ func generateRedisConfigMap(rf *redisfailoverv1.RedisFailover, labels map[string func generateRedisShutdownConfigMap(rf *redisfailoverv1.RedisFailover, labels map[string]string, ownerRefs []metav1.OwnerReference) *corev1.ConfigMap { name := GetRedisShutdownConfigMapName(rf) namespace := rf.Namespace - rfName := strings.ToUpper(rf.Name) + rfName := strings.Replace(strings.ToUpper(rf.Name), "-", "_", -1) labels = util.MergeLabels(labels, generateSelectorLabels(redisRoleName, rf.Name)) shutdownContent := fmt.Sprintf(`master=$(redis-cli -h ${RFS_%[1]v_SERVICE_HOST} -p ${RFS_%[1]v_SERVICE_PORT_SENTINEL} --csv SENTINEL get-master-addr-by-name mymaster | tr ',' ' ' | tr -d '\"' |cut -d' ' -f1)