From 4ff76d712700da125ec8e1c955bf9877a6a7c44d Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Mon, 29 Apr 2024 16:13:21 +0200 Subject: [PATCH] Use tls for cache if supported Jira: OSPRH-5283 --- controllers/neutronapi_controller.go | 1 + templates/neutronapi/config/01-neutron.conf | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/controllers/neutronapi_controller.go b/controllers/neutronapi_controller.go index 38208abb..947bfe9e 100644 --- a/controllers/neutronapi_controller.go +++ b/controllers/neutronapi_controller.go @@ -1487,6 +1487,7 @@ func (r *NeutronAPIReconciler) generateServiceSecrets( templateParameters["TransportURL"] = transportURL templateParameters["MemcachedServers"] = mc.GetMemcachedServerListString() templateParameters["MemcachedServersWithInet"] = mc.GetMemcachedServerListWithInetString() + templateParameters["MemcachedTLS"] = mc.GetMemcachedTLSSupport() // Other OpenStack services servicePassword := string(ospSecret.Data[instance.Spec.PasswordSelectors.Service]) diff --git a/templates/neutronapi/config/01-neutron.conf b/templates/neutronapi/config/01-neutron.conf index 9e89979a..15ac0214 100644 --- a/templates/neutronapi/config/01-neutron.conf +++ b/templates/neutronapi/config/01-neutron.conf @@ -89,9 +89,14 @@ password = {{ .ServicePassword }} lock_path = /var/lib/neutron/tmp [cache] -backend=dogpile.cache.pymemcache +{{if .MemcachedTLS}} +backend = dogpile.cache.pymemcache +{{else}} +backend = dogpile.cache.memcached +{{end}} enabled=true memcache_servers={{ .MemcachedServers }} +tls_enabled={{ .MemcachedTLS }} [oslo_policy] enforce_scope = True