diff --git a/controllers/configmap.go b/controllers/configmap.go index fb59956d..cba7f201 100644 --- a/controllers/configmap.go +++ b/controllers/configmap.go @@ -65,7 +65,7 @@ var ( ) const ( - ClusterTextLogFormat = "[%START_TIME%] %BYTES_RECEIVED% %BYTES_SENT% %DURATION% \"%DOWNSTREAM_REMOTE_ADDRESS%\" \"%UPSTREAM_HOST%\" \"%UPSTREAM_CLUSTER%\"" + ClusterTextLogFormat = "[%START_TIME%] %BYTES_RECEIVED% %BYTES_SENT% %DURATION% \"%DOWNSTREAM_REMOTE_ADDRESS%\" \"%UPSTREAM_HOST%\" \"%UPSTREAM_CLUSTER%\"\n" AdminTextLogFormat = "[%START_TIME%] \"%REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %PROTOCOL%\" %RESPONSE_CODE% %RESPONSE_FLAGS% %BYTES_RECEIVED% %BYTES_SENT% %DURATION% %RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)% \"%REQ(X-FORWARDED-FOR)%\" \"%REQ(USER-AGENT)%\" \"%REQ(X-REQUEST-ID)%\" \"%REQ(:AUTHORITY)%\" \"%UPSTREAM_HOST%\"\n" ) diff --git a/controllers/configmap_test.go b/controllers/configmap_test.go index e2f006e3..51818a8d 100644 --- a/controllers/configmap_test.go +++ b/controllers/configmap_test.go @@ -101,8 +101,8 @@ staticResources: contentType: application/json; charset=UTF-8 omitEmptyValues: true textFormatSource: - inlineString: '[%START_TIME%] %BYTES_RECEIVED% %BYTES_SENT% %DURATION% - "%DOWNSTREAM_REMOTE_ADDRESS%" "%UPSTREAM_HOST%" "%UPSTREAM_CLUSTER%"' + inlineString: | + [%START_TIME%] %BYTES_RECEIVED% %BYTES_SENT% %DURATION% "%DOWNSTREAM_REMOTE_ADDRESS%" "%UPSTREAM_HOST%" "%UPSTREAM_CLUSTER%" cluster: foo_UDP_100 statPrefix: udp_proxy name: foo_UDP_100 @@ -123,8 +123,8 @@ staticResources: contentType: application/json; charset=UTF-8 omitEmptyValues: true textFormatSource: - inlineString: '[%START_TIME%] %BYTES_RECEIVED% %BYTES_SENT% %DURATION% - "%DOWNSTREAM_REMOTE_ADDRESS%" "%UPSTREAM_HOST%" "%UPSTREAM_CLUSTER%"' + inlineString: | + [%START_TIME%] %BYTES_RECEIVED% %BYTES_SENT% %DURATION% "%DOWNSTREAM_REMOTE_ADDRESS%" "%UPSTREAM_HOST%" "%UPSTREAM_CLUSTER%" cluster: foo_TCP_101 statPrefix: tcp_proxy name: foo_TCP_101 @@ -354,7 +354,7 @@ staticResources: t.Error(err) } if got != tt.want { - t.Errorf("envoyConfig() = %v, want %v", got, tt.want) + t.Errorf("got:\n%v, want:\n%v", got, tt.want) t.Error(cmp.Diff(got, tt.want)) } })