@@ -2,18 +2,15 @@ package e2e_test
2
2
3
3
import (
4
4
"context"
5
- "fmt"
6
5
"net/http"
7
6
"time"
8
7
9
- "github.com/solo-io/gloo/test/helpers"
10
8
"github.com/solo-io/gloo/test/testutils"
11
9
12
10
"github.com/solo-io/gloo/test/gomega/matchers"
13
11
14
12
envoy_data_accesslog_v3 "github.com/envoyproxy/go-control-plane/envoy/data/accesslog/v3"
15
13
v1 "github.com/solo-io/gloo/projects/gateway/pkg/api/v1"
16
-
17
14
"github.com/solo-io/gloo/test/e2e"
18
15
19
16
envoyals "github.com/envoyproxy/go-control-plane/envoy/service/accesslog/v3"
@@ -28,7 +25,6 @@ import (
28
25
29
26
gloov1 "github.com/solo-io/gloo/projects/gloo/pkg/api/v1"
30
27
"github.com/solo-io/gloo/projects/gloo/pkg/api/v1/options/als"
31
- "github.com/solo-io/gloo/projects/gloo/pkg/api/v1/options/dynamic_forward_proxy"
32
28
alsplugin "github.com/solo-io/gloo/projects/gloo/pkg/plugins/als"
33
29
"github.com/solo-io/gloo/projects/gloo/pkg/translator"
34
30
)
@@ -116,105 +112,6 @@ var _ = Describe("Access Log", func() {
116
112
117
113
})
118
114
119
- FContext ("Grpc with filter state objects" , func () {
120
-
121
- var (
122
- msgChan <- chan * envoy_data_accesslog_v3.HTTPAccessLogEntry
123
- )
124
-
125
- BeforeEach (func () {
126
- msgChan = runAccessLog (testContext .Ctx (), testContext .EnvoyInstance ().AccessLogPort )
127
-
128
- gw := gwdefaults .DefaultGateway (writeNamespace )
129
- gw .Options = & gloov1.ListenerOptions {
130
- AccessLoggingService : & als.AccessLoggingService {
131
- AccessLog : []* als.AccessLog {
132
- {
133
- OutputDestination : & als.AccessLog_GrpcService {
134
- GrpcService : & als.GrpcService {
135
- LogName : "test-log" ,
136
- ServiceRef : & als.GrpcService_StaticClusterName {
137
- StaticClusterName : alsplugin .ClusterName ,
138
- },
139
- FilterStateObjectsToLog : []string {
140
- "envoy.network.upstream_server_name" ,
141
- "envoy.network.application_protocols" ,
142
- "envoy.network.upstream_subject_alt_names" ,
143
- "envoy.tcp_proxy.cluster" ,
144
- "envoy.udp_proxy.cluster" ,
145
- "envoy.network.transport_socket.original_dst_address" ,
146
- "envoy.filters.listener.original_dst.local_ip" ,
147
- "envoy.filters.listener.original_dst.remote_ip" ,
148
- "envoy.upstream.dynamic_host" ,
149
- "envoy.upstream.dynamic_port" ,
150
- "envoy.tcp_proxy.disable_tunneling" ,
151
- "envoy.filters.network.http_connection_manager.local_reply_owner" ,
152
- "envoy.string" ,
153
- "envoy.tcp_proxy.per_connection_idle_timeout_ms" ,
154
- "envoy.ratelimit.hits_addend" ,
155
- },
156
- },
157
- },
158
- },
159
- },
160
- },
161
- }
162
-
163
- // enable dynamic forward proxy to save upstream address in filter state
164
- gw .GetHttpGateway ().Options = & gloov1.HttpListenerOptions {
165
- DynamicForwardProxy : & dynamic_forward_proxy.FilterConfig {
166
- SaveUpstreamAddress : true ,
167
- }, // pick up system defaults to resolve DNS
168
- }
169
-
170
- testContext .ResourcesToCreate ().Gateways = v1.GatewayList {
171
- gw ,
172
- }
173
-
174
- vs := helpers .NewVirtualServiceBuilder ().
175
- WithName (e2e .DefaultVirtualServiceName ).
176
- WithNamespace (writeNamespace ).
177
- WithDomain (e2e .DefaultHost ).
178
- WithRoutePrefixMatcher (e2e .DefaultRouteName , "/" ).
179
- WithRouteAction (e2e .DefaultRouteName , & gloov1.RouteAction {
180
- Destination : & gloov1.RouteAction_DynamicForwardProxy {
181
- DynamicForwardProxy : & dynamic_forward_proxy.PerRouteConfig {
182
- HostRewriteSpecifier : & dynamic_forward_proxy.PerRouteConfig_AutoHostRewriteHeader {
183
- AutoHostRewriteHeader : "x-rewrite-me" ,
184
- },
185
- },
186
- },
187
- }).
188
- Build ()
189
-
190
- testContext .ResourcesToCreate ().VirtualServices = v1.VirtualServiceList {
191
- vs ,
192
- }
193
- })
194
-
195
- It ("can stream access logs with filter state objects" , func () {
196
- requestBuilder := testContext .GetHttpRequestBuilder ().
197
- WithPath ("get" ).
198
- WithHeader ("x-rewrite-me" , "postman-echo.com" )
199
-
200
- Eventually (func (g Gomega ) {
201
- g .Expect (testutils .DefaultHttpClient .Do (requestBuilder .Build ())).Should (matchers .HaveHttpResponse (& matchers.HttpResponse {
202
- StatusCode : http .StatusOK ,
203
- Body : ContainSubstring (`"host": "postman-echo.com"` ),
204
- }))
205
-
206
- var entry * envoy_data_accesslog_v3.HTTPAccessLogEntry
207
- g .Eventually (msgChan , 2 * time .Second ).Should (Receive (& entry ))
208
-
209
- fmt .Printf ("entry.CommonProperties.UpstreamCluster: %s\n " , entry .CommonProperties .UpstreamCluster )
210
- fmt .Printf ("entry.CommonProperties.FilterStateObjects: %+v\n " , entry .CommonProperties .FilterStateObjects )
211
- g .Expect (entry .CommonProperties .UpstreamCluster ).To (Equal ("solo_io_generated_dfp:13273938298451159843" ))
212
- g .Expect (entry .CommonProperties .FilterStateObjects ).To (ContainSubstring (`"upstream_remote_address":"10.244.0.1:80"` ))
213
- }, time .Second * 21 , time .Second * 2 ).Should (Succeed ())
214
- })
215
-
216
- })
217
-
218
115
Context ("File" , func () {
219
116
var gw * v1.Gateway
220
117
Context ("String Format" , func () {
0 commit comments