@@ -89,15 +89,13 @@ var _ = Describe("GenerateServerConfigMap", func() {
8989 When ("additionalConfig is not provided" , func () {
9090 It ("returns the default rabbitmq conf" , func () {
9191 builder .Instance .Spec .Rabbitmq .AdditionalConfig = ""
92- defaultRabbitmqConf := `cluster_formation.peer_discovery_backend = rabbit_peer_discovery_k8s
93- cluster_formation.k8s.host = kubernetes.default
94- cluster_formation.k8s.address_type = hostname
95- cluster_formation.node_cleanup.interval = 30
96- cluster_formation.node_cleanup.only_log_warning = true
97- cluster_partition_handling = pause_minority
98- queue_master_locator = min-masters
99- disk_free_limit.absolute = 2GB
100- cluster_name = ` + builder .Instance .Name + "\n "
92+ defaultRabbitmqConf := `cluster_formation.peer_discovery_backend = rabbit_peer_discovery_k8s
93+ cluster_formation.k8s.host = kubernetes.default
94+ cluster_formation.k8s.address_type = hostname
95+ cluster_partition_handling = pause_minority
96+ queue_master_locator = min-masters
97+ disk_free_limit.absolute = 2GB
98+ cluster_name = ` + builder .Instance .Name + "\n "
10199 Expect (configMapBuilder .Update (configMap )).To (Succeed ())
102100 Expect (configMap .Data ).To (HaveKeyWithValue ("rabbitmq.conf" , defaultRabbitmqConf ))
103101 })
@@ -111,17 +109,15 @@ my-config-property-1 = better-value`
111109 })
112110
113111 It ("appends configurations to the default rabbitmq.conf and overwrites duplicate keys" , func () {
114- expectedRabbitmqConf := `cluster_formation.peer_discovery_backend = my-backend
115- cluster_formation.k8s.host = kubernetes.default
116- cluster_formation.k8s.address_type = hostname
117- cluster_formation.node_cleanup.interval = 30
118- cluster_formation.node_cleanup.only_log_warning = true
119- cluster_partition_handling = pause_minority
120- queue_master_locator = min-masters
121- disk_free_limit.absolute = 2GB
122- cluster_name = ` + builder .Instance .Name + `
123- my-config-property-0 = great-value
124- my-config-property-1 = better-value
112+ expectedRabbitmqConf := `cluster_formation.peer_discovery_backend = my-backend
113+ cluster_formation.k8s.host = kubernetes.default
114+ cluster_formation.k8s.address_type = hostname
115+ cluster_partition_handling = pause_minority
116+ queue_master_locator = min-masters
117+ disk_free_limit.absolute = 2GB
118+ cluster_name = ` + builder .Instance .Name + `
119+ my-config-property-0 = great-value
120+ my-config-property-1 = better-value
125121`
126122
127123 Expect (configMapBuilder .Update (configMap )).To (Succeed ())
@@ -223,9 +219,9 @@ CONSOLE_LOG=new`
223219
224220 Expect (configMapBuilder .Update (configMap )).To (Succeed ())
225221 Expect (configMap .Data ).To (HaveKeyWithValue ("rabbitmq.conf" , ContainSubstring (`
226- ssl_options.certfile = /etc/rabbitmq-tls/tls.crt
227- ssl_options.keyfile = /etc/rabbitmq-tls/tls.key
228- listeners.ssl.default = 5671` )))
222+ ssl_options.certfile = /etc/rabbitmq-tls/tls.crt
223+ ssl_options.keyfile = /etc/rabbitmq-tls/tls.key
224+ listeners.ssl.default = 5671` )))
229225 })
230226 })
231227
@@ -246,11 +242,11 @@ listeners.ssl.default = 5671`)))
246242
247243 Expect (configMapBuilder .Update (configMap )).To (Succeed ())
248244 Expect (configMap .Data ).To (HaveKeyWithValue ("rabbitmq.conf" , ContainSubstring (`
249- ssl_options.certfile = /etc/rabbitmq-tls/tls.crt
250- ssl_options.keyfile = /etc/rabbitmq-tls/tls.key
251- listeners.ssl.default = 5671
252- ssl_options.cacertfile = /etc/rabbitmq-tls/ca.certificate
253- ssl_options.verify = verify_peer` )))
245+ ssl_options.certfile = /etc/rabbitmq-tls/tls.crt
246+ ssl_options.keyfile = /etc/rabbitmq-tls/tls.key
247+ listeners.ssl.default = 5671
248+ ssl_options.cacertfile = /etc/rabbitmq-tls/ca.certificate
249+ ssl_options.verify = verify_peer` )))
254250 })
255251 })
256252
@@ -271,7 +267,7 @@ ssl_options.verify = verify_peer`)))
271267 }
272268
273269 Expect (configMapBuilder .Update (configMap )).To (Succeed ())
274- Expect (configMap .Data ).To (HaveKeyWithValue ("rabbitmq.conf" , ContainSubstring (fmt .Sprintf ("total_memory_available_override_value = %d" , 8 * GiB ))))
270+ Expect (configMap .Data ).To (HaveKeyWithValue ("rabbitmq.conf" , ContainSubstring (fmt .Sprintf ("total_memory_available_override_value = %d" , 8 * GiB ))))
275271 })
276272 })
277273
0 commit comments