Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix default cache config for no tls #910

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion templates/nova.conf
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,11 @@ enabled = True
# on contoler we prefer to use memcache when its deployed
{{if .MemcachedTLS}}
backend = dogpile.cache.pymemcache
memcache_servers={{ .MemcachedServers }}
{{else}}
backend = dogpile.cache.memcached
memcache_servers={{ .MemcachedServersWithInet }}
{{end}}
memcache_servers={{ .MemcachedServers }}
tls_enabled={{ .MemcachedTLS }}
{{else}}
# on compute nodes or where memcache is not deployed we should use an in memory
Expand Down
10 changes: 3 additions & 7 deletions test/functional/nova_metadata_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,12 @@ var _ = Describe("NovaMetadata controller", func() {
Expect(configData).Should(ContainSubstring("dhcp_domain = ''"))
Expect(configData).Should(
ContainSubstring("[upgrade_levels]\ncompute = auto"))
memcacheInstance := infra.GetMemcached(novaNames.MemcachedNamespace)
Expect(configData).Should(
ContainSubstring("backend = dogpile.cache.memcached"))
Expect(configData).Should(
ContainSubstring(fmt.Sprintf("memcache_servers=memcached-0.memcached.%s.svc:11211,memcached-1.memcached.%s.svc:11211,memcached-2.memcached.%s.svc:11211",
novaNames.Namespace, novaNames.Namespace, novaNames.Namespace)))
Expect(configData).Should(
ContainSubstring(fmt.Sprintf("memcached_servers=inet:[memcached-0.memcached.%s.svc]:11211,inet:[memcached-1.memcached.%s.svc]:11211,inet:[memcached-2.memcached.%s.svc]:11211",
novaNames.Namespace, novaNames.Namespace, novaNames.Namespace)))
Expect(configData).Should(
ContainSubstring("tls_enabled=false"))
ContainSubstring(fmt.Sprintf("memcache_servers=%s", memcacheInstance.GetMemcachedServerListWithInetString())))
bogdando marked this conversation as resolved.
Show resolved Hide resolved
ContainSubstring("tls_enabled=false")
Expect(configDataMap.Data).Should(HaveKey("02-nova-override.conf"))
myCnf := configDataMap.Data["my.cnf"]
Expect(myCnf).To(
Expand Down
4 changes: 2 additions & 2 deletions test/functional/nova_multicell_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ var _ = Describe("Nova multi cell", func() {
apiAccount.Spec.UserName, apiSecret.Data[mariadbv1.DatabasePasswordSelector],
novaNames.APIMariaDBDatabaseName.Name, novaNames.Namespace)),
)
Expect(configData).Should(
Expect(configData).ShouldNot(
ContainSubstring(fmt.Sprintf("memcache_servers=memcached-0.memcached.%s.svc:11211,memcached-1.memcached.%s.svc:11211,memcached-2.memcached.%s.svc:11211",
novaNames.Namespace, novaNames.Namespace, novaNames.Namespace)))
Expect(configData).Should(
Expand Down Expand Up @@ -373,7 +373,7 @@ var _ = Describe("Nova multi cell", func() {
)

Expect(configData).To(ContainSubstring("transport_url=rabbit://cell1/fake"))
Expect(configData).Should(
Expect(configData).ShouldNot(
ContainSubstring(fmt.Sprintf("memcache_servers=memcached1-0.memcached1.%s.svc:11211,memcached1-1.memcached1.%s.svc:11211,memcached1-2.memcached1.%s.svc:11211",
novaNames.Namespace, novaNames.Namespace, novaNames.Namespace)))
Expect(configData).Should(
Expand Down
6 changes: 4 additions & 2 deletions test/functional/nova_novncproxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,11 @@ var _ = Describe("NovaNoVNCProxy controller", func() {
Expect(configData).Should(ContainSubstring("password = service-password"))
Expect(configData).Should(
ContainSubstring("backend = dogpile.cache.memcached"))
memcacheInstance := infra.GetMemcached(novaNames.MemcachedNamespace)
Expect(configData).Should(
ContainSubstring(fmt.Sprintf("memcache_servers=memcached-0.memcached.%s.svc:11211,memcached-1.memcached.%s.svc:11211,memcached-2.memcached.%s.svc:11211",
novaNames.Namespace, novaNames.Namespace, novaNames.Namespace)))
ContainSubstring("backend = dogpile.cache.memcached"))
Expect(configData).Should(
ContainSubstring(fmt.Sprintf("memcache_servers=%s", memcacheInstance.GetMemcachedServerListWithInetString())))
Expect(configData).Should(
ContainSubstring(fmt.Sprintf("memcached_servers=inet:[memcached-0.memcached.%s.svc]:11211,inet:[memcached-1.memcached.%s.svc]:11211,inet:[memcached-2.memcached.%s.svc]:11211",
novaNames.Namespace, novaNames.Namespace, novaNames.Namespace)))
Expand Down
4 changes: 2 additions & 2 deletions test/functional/nova_reconfiguration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ var _ = Describe("Nova reconfiguration", func() {
Expect(configDataMap).ShouldNot(BeNil())
Expect(configDataMap.Data).Should(HaveKey("01-nova.conf"))
configData := string(configDataMap.Data["01-nova.conf"])
Expect(configData).Should(
Expect(configData).ShouldNot(
ContainSubstring(fmt.Sprintf("memcache_servers=memcached-0.memcached.%s.svc:11211,memcached-1.memcached.%s.svc:11211,memcached-2.memcached.%s.svc:11211",
novaNames.Namespace, novaNames.Namespace, novaNames.Namespace)))
Expect(configData).Should(
Expand All @@ -801,7 +801,7 @@ var _ = Describe("Nova reconfiguration", func() {
g.Expect(configDataMap).ShouldNot(BeNil())
g.Expect(configDataMap.Data).Should(HaveKey("01-nova.conf"))
configData = string(configDataMap.Data["01-nova.conf"])
g.Expect(configData).To(ContainSubstring("memcache_servers=new"))
g.Expect(configData).ToNot(ContainSubstring("memcache_servers=new"))
g.Expect(configData).To(ContainSubstring("memcached_servers=inet_new"))
}, timeout, interval).Should(Succeed())
})
Expand Down
7 changes: 2 additions & 5 deletions test/functional/nova_scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,11 @@ var _ = Describe("NovaScheduler controller", func() {
configData := string(configDataMap.Data["01-nova.conf"])
Expect(configData).To(ContainSubstring("transport_url=rabbit://api/fake"))
Expect(configData).To(ContainSubstring("password = service-password"))
memcacheInstance := infra.GetMemcached(novaNames.MemcachedNamespace)
Expect(configData).Should(
ContainSubstring("backend = dogpile.cache.memcached"))
Expect(configData).Should(
ContainSubstring(fmt.Sprintf("memcache_servers=memcached-0.memcached.%s.svc:11211,memcached-1.memcached.%s.svc:11211,memcached-2.memcached.%s.svc:11211",
novaNames.Namespace, novaNames.Namespace, novaNames.Namespace)))
Expect(configData).Should(
ContainSubstring(fmt.Sprintf("memcached_servers=inet:[memcached-0.memcached.%s.svc]:11211,inet:[memcached-1.memcached.%s.svc]:11211,inet:[memcached-2.memcached.%s.svc]:11211",
novaNames.Namespace, novaNames.Namespace, novaNames.Namespace)))
ContainSubstring(fmt.Sprintf("memcache_servers=%s", memcacheInstance.GetMemcachedServerListWithInetString())))
Expect(configData).Should(
ContainSubstring("tls_enabled=false"))
Expect(configData).Should(
Expand Down
4 changes: 2 additions & 2 deletions test/functional/novaapi_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,11 @@ var _ = Describe("NovaAPI controller", func() {
Expect(configData).Should(ContainSubstring("www_authenticate_uri = keystone-public-auth-url"))
Expect(configData).Should(
ContainSubstring("[upgrade_levels]\ncompute = auto"))
memcacheInstance := infra.GetMemcached(novaNames.MemcachedNamespace)
Expect(configData).Should(
ContainSubstring("backend = dogpile.cache.memcached"))
Expect(configData).Should(
ContainSubstring(fmt.Sprintf("memcache_servers=memcached-0.memcached.%s.svc:11211,memcached-1.memcached.%s.svc:11211,memcached-2.memcached.%s.svc:11211",
novaNames.Namespace, novaNames.Namespace, novaNames.Namespace)))
ContainSubstring(fmt.Sprintf("memcache_servers=%s", memcacheInstance.GetMemcachedServerListWithInetString())))
Expect(configData).Should(
ContainSubstring(fmt.Sprintf("memcached_servers=inet:[memcached-0.memcached.%s.svc]:11211,inet:[memcached-1.memcached.%s.svc]:11211,inet:[memcached-2.memcached.%s.svc]:11211",
novaNames.Namespace, novaNames.Namespace, novaNames.Namespace)))
Expand Down
2 changes: 1 addition & 1 deletion test/functional/novaconductor_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ var _ = Describe("NovaConductor controller", func() {
ContainSubstring("[upgrade_levels]\ncompute = auto"))
Expect(configData).Should(
ContainSubstring("backend = dogpile.cache.memcached"))
Expect(configData).Should(
Expect(configData).ShouldNot(
ContainSubstring(fmt.Sprintf("memcache_servers=memcached-0.memcached.%s.svc:11211,memcached-1.memcached.%s.svc:11211,memcached-2.memcached.%s.svc:11211",
novaNames.Namespace, novaNames.Namespace, novaNames.Namespace)))
Expect(configData).Should(
Expand Down
Loading