From c97d6e11100da10b418899ebeacf28593e770dde Mon Sep 17 00:00:00 2001 From: Elvin Efendi Date: Thu, 31 May 2018 13:46:35 -0400 Subject: [PATCH 1/2] log annotation should be set for catch-all servers --- internal/ingress/controller/controller.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/ingress/controller/controller.go b/internal/ingress/controller/controller.go index 33c54af9c..c50d615d0 100644 --- a/internal/ingress/controller/controller.go +++ b/internal/ingress/controller/controller.go @@ -910,6 +910,7 @@ func (n *NGINXController) createServers(data []*extensions.Ingress, defLoc.Ingress = ing // we need to use the ingress annotations + defLoc.Logs = anns.Logs defLoc.BasicDigestAuth = anns.BasicDigestAuth defLoc.ClientBodyBufferSize = anns.ClientBodyBufferSize defLoc.ConfigurationSnippet = anns.ConfigurationSnippet From d4e6c0dfd802b002b6c033bf4b11cc10d9828d06 Mon Sep 17 00:00:00 2001 From: Elvin Efendi Date: Thu, 31 May 2018 13:46:59 -0400 Subject: [PATCH 2/2] access_log should be off for internal /configuration endpoint --- rootfs/etc/nginx/template/nginx.tmpl | 1 + test/e2e/lua/dynamic_configuration.go | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/rootfs/etc/nginx/template/nginx.tmpl b/rootfs/etc/nginx/template/nginx.tmpl index fa1fa49f3..7cae84113 100644 --- a/rootfs/etc/nginx/template/nginx.tmpl +++ b/rootfs/etc/nginx/template/nginx.tmpl @@ -541,6 +541,7 @@ http { {{ if $all.DynamicConfigurationEnabled }} location /configuration { + access_log off; {{ if $cfg.EnableOpentracing }} opentracing off; {{ end }} diff --git a/test/e2e/lua/dynamic_configuration.go b/test/e2e/lua/dynamic_configuration.go index 60d686584..17bad12de 100644 --- a/test/e2e/lua/dynamic_configuration.go +++ b/test/e2e/lua/dynamic_configuration.go @@ -135,7 +135,9 @@ var _ = framework.IngressNginxDescribe("Dynamic Configuration", func() { Expect(log).ToNot(BeEmpty()) By("POSTing new backends to Lua endpoint") - Expect(restOfLogs).To(ContainSubstring("a client request body is buffered to a temporary file")) + // NOTE(elvinefendi) now that we disabled access log for this endpoint we have to find a different way to assert this + // or maybe delete this test completely and just rely on unit testing of Lua middleware? + //Expect(restOfLogs).To(ContainSubstring("a client request body is buffered to a temporary file")) Expect(restOfLogs).ToNot(ContainSubstring("dynamic-configuration: unable to read valid request body")) })