|
8 | 8 | envoy_config_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
|
9 | 9 | envoy_config_listener_v3 "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3"
|
10 | 10 | routerv3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/router/v3"
|
11 |
| - codecv3 "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/upstream_codec/v3" |
12 | 11 | envoyhttp "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3"
|
13 | 12 | envoytcp "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/tcp_proxy/v3"
|
14 | 13 | envoyauth "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3"
|
@@ -305,8 +304,6 @@ func (h *hcmNetworkFilterTranslator) computeHttpFilters(ctx context.Context, l i
|
305 | 304 | // as the terminal filter in kgateway.
|
306 | 305 | routerV3 := routerv3.Router{}
|
307 | 306 |
|
308 |
| - h.computeUpstreamHTTPFilters(ctx, l, &routerV3) |
309 |
| - |
310 | 307 | // // TODO it would be ideal of SuppressEnvoyHeaders and DynamicStats could be moved out of here set
|
311 | 308 | // // in a separate router plugin
|
312 | 309 | // if h.listener.GetOptions().GetRouter().GetSuppressEnvoyHeaders().GetValue() {
|
@@ -335,62 +332,6 @@ func (h *hcmNetworkFilterTranslator) computeHttpFilters(ctx context.Context, l i
|
335 | 332 | return envoyHttpFilters
|
336 | 333 | }
|
337 | 334 |
|
338 |
| -func (h *hcmNetworkFilterTranslator) computeUpstreamHTTPFilters(ctx context.Context, l ir.HttpFilterChainIR, routerV3 *routerv3.Router) { |
339 |
| - upstreamHttpFilters := plugins.StagedUpstreamHttpFilterList{} |
340 |
| - log := contextutils.LoggerFrom(ctx).Desugar() |
341 |
| - for _, plug := range h.PluginPass { |
342 |
| - stagedFilters, err := plug.UpstreamHttpFilters(ctx) |
343 |
| - if err != nil { |
344 |
| - // what to do with errors here? ignore the listener?? |
345 |
| - h.reporter.SetCondition(reports.ListenerCondition{ |
346 |
| - Type: gwv1.ListenerConditionProgrammed, |
347 |
| - Reason: gwv1.ListenerReasonInvalid, |
348 |
| - Status: metav1.ConditionFalse, |
349 |
| - Message: "Error processing upstream http plugin: " + err.Error(), |
350 |
| - }) |
351 |
| - // TODO: return false? |
352 |
| - } |
353 |
| - for _, httpFilter := range stagedFilters { |
354 |
| - if httpFilter.Filter == nil { |
355 |
| - log.Warn("HttpFilters() returned nil", zap.String("name", plug.Name)) |
356 |
| - continue |
357 |
| - } |
358 |
| - upstreamHttpFilters = append(upstreamHttpFilters, httpFilter) |
359 |
| - } |
360 |
| - } |
361 |
| - |
362 |
| - if len(upstreamHttpFilters) == 0 { |
363 |
| - return |
364 |
| - } |
365 |
| - |
366 |
| - sort.Sort(upstreamHttpFilters) |
367 |
| - |
368 |
| - sortedFilters := make([]*envoyhttp.HttpFilter, len(upstreamHttpFilters)) |
369 |
| - for i, filter := range upstreamHttpFilters { |
370 |
| - sortedFilters[i] = filter.Filter |
371 |
| - } |
372 |
| - |
373 |
| - msg, err := anypb.New(&codecv3.UpstreamCodec{}) |
374 |
| - if err != nil { |
375 |
| - // what to do with errors here? ignore the listener?? |
376 |
| - h.reporter.SetCondition(reports.ListenerCondition{ |
377 |
| - Type: gwv1.ListenerConditionProgrammed, |
378 |
| - Reason: gwv1.ListenerReasonInvalid, |
379 |
| - Status: metav1.ConditionFalse, |
380 |
| - Message: "failed to convert proto message to any: " + err.Error(), |
381 |
| - }) |
382 |
| - return |
383 |
| - } |
384 |
| - |
385 |
| - routerV3.UpstreamHttpFilters = sortedFilters |
386 |
| - routerV3.UpstreamHttpFilters = append(routerV3.GetUpstreamHttpFilters(), &envoyhttp.HttpFilter{ |
387 |
| - Name: UpstreamCodeFilterName, |
388 |
| - ConfigType: &envoyhttp.HttpFilter_TypedConfig{ |
389 |
| - TypedConfig: msg, |
390 |
| - }, |
391 |
| - }) |
392 |
| -} |
393 |
| - |
394 | 335 | func sortHttpFilters(filters plugins.StagedHttpFilterList) []*envoyhttp.HttpFilter {
|
395 | 336 | sort.Sort(filters)
|
396 | 337 | var sortedFilters []*envoyhttp.HttpFilter
|
|
0 commit comments