Skip to content

Commit 02ee7d9

Browse files
author
Shriram Rajagopalan
committed
Revert "Mixer route cache (#10539)"
This reverts commit 024adb0.
1 parent 024adb0 commit 02ee7d9

File tree

10 files changed

+41
-308
lines changed

10 files changed

+41
-308
lines changed

pilot/pkg/networking/core/v1alpha3/configgen.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ type ConfigGeneratorImpl struct {
3030
// Must be rebuilt for each push epoch
3131
PrecomputedOutboundClusters map[string][]*xdsapi.Cluster
3232
// TODO: add others in future
33-
34-
// PerRouteFilterConfig has plugin Router Filter config
35-
PerRouteFilterConfig map[plugin.Name]interface{}
3633
}
3734

3835
func NewConfigGenerator(plugins []plugin.Plugin) *ConfigGeneratorImpl {
@@ -70,14 +67,6 @@ func (configgen *ConfigGeneratorImpl) BuildSharedPushState(env *model.Environmen
7067
wg.Wait()
7168

7269
configgen.PrecomputedOutboundClusters = clustersByNamespace
73-
for _, p := range configgen.Plugins {
74-
perRouteFilterConfig := p.OnPreComputePerRouteFilterConfig(env, push)
75-
if perRouteFilterConfig != nil {
76-
configgen.PerRouteFilterConfig = make(map[plugin.Name]interface{})
77-
configgen.PerRouteFilterConfig[p.GetName()] = perRouteFilterConfig
78-
break
79-
}
80-
}
8170
return nil
8271
}
8372

pilot/pkg/networking/core/v1alpha3/configgen_test.go

Lines changed: 0 additions & 91 deletions
This file was deleted.

pilot/pkg/networking/core/v1alpha3/gateway.go

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"github.com/envoyproxy/go-control-plane/envoy/api/v2/listener"
2525
"github.com/envoyproxy/go-control-plane/envoy/api/v2/route"
2626
http_conn "github.com/envoyproxy/go-control-plane/envoy/config/filter/network/http_connection_manager/v2"
27-
"github.com/gogo/protobuf/types"
2827
multierror "github.com/hashicorp/go-multierror"
2928

3029
networking "istio.io/api/networking/v1alpha3"
@@ -284,20 +283,12 @@ func (configgen *ConfigGeneratorImpl) buildGatewayHTTPRouteConfig(env *model.Env
284283
ValidateClusters: proto.BoolFalse,
285284
}
286285
// call plugins
287-
288286
for _, p := range configgen.Plugins {
289-
var perRouteFilterConfig map[string]*types.Struct
290-
if c, ok := configgen.PerRouteFilterConfig[p.GetName()].(map[string]*types.Struct); ok {
291-
perRouteFilterConfig = c
292-
} else {
293-
perRouteFilterConfig = nil
294-
}
295287
in := &plugin.InputParams{
296-
ListenerProtocol: plugin.ListenerProtocolHTTP,
297-
Env: env,
298-
Node: node,
299-
Push: push,
300-
PerRouteFilterConfig: perRouteFilterConfig,
288+
ListenerProtocol: plugin.ListenerProtocolHTTP,
289+
Env: env,
290+
Node: node,
291+
Push: push,
301292
}
302293
p.OnOutboundRouteConfiguration(in, routeCfg)
303294
}

pilot/pkg/networking/core/v1alpha3/httproute.go

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121

2222
xdsapi "github.com/envoyproxy/go-control-plane/envoy/api/v2"
2323
"github.com/envoyproxy/go-control-plane/envoy/api/v2/route"
24-
"github.com/gogo/protobuf/types"
2524

2625
"istio.io/istio/pilot/pkg/model"
2726
istio_route "istio.io/istio/pilot/pkg/networking/core/v1alpha3/route"
@@ -73,20 +72,13 @@ func (configgen *ConfigGeneratorImpl) buildSidecarInboundHTTPRouteConfig(env *mo
7372
}
7473

7574
for _, p := range configgen.Plugins {
76-
var perRouteFilterConfig map[string]*types.Struct
77-
if c, ok := configgen.PerRouteFilterConfig[p.GetName()].(map[string]*types.Struct); ok {
78-
perRouteFilterConfig = c
79-
} else {
80-
perRouteFilterConfig = nil
81-
}
8275
in := &plugin.InputParams{
83-
ListenerProtocol: plugin.ListenerProtocolHTTP,
84-
Env: env,
85-
Node: node,
86-
ServiceInstance: instance,
87-
Service: instance.Service,
88-
Push: push,
89-
PerRouteFilterConfig: perRouteFilterConfig,
76+
ListenerProtocol: plugin.ListenerProtocolHTTP,
77+
Env: env,
78+
Node: node,
79+
ServiceInstance: instance,
80+
Service: instance.Service,
81+
Push: push,
9082
}
9183
p.OnInboundRouteConfiguration(in, r)
9284
}
@@ -185,18 +177,11 @@ func (configgen *ConfigGeneratorImpl) buildSidecarOutboundHTTPRouteConfig(env *m
185177

186178
// call plugins
187179
for _, p := range configgen.Plugins {
188-
var perRouteFilterConfig map[string]*types.Struct
189-
if c, ok := configgen.PerRouteFilterConfig[p.GetName()].(map[string]*types.Struct); ok {
190-
perRouteFilterConfig = c
191-
} else {
192-
perRouteFilterConfig = nil
193-
}
194180
in := &plugin.InputParams{
195-
ListenerProtocol: plugin.ListenerProtocolHTTP,
196-
Env: env,
197-
Node: node,
198-
Push: push,
199-
PerRouteFilterConfig: perRouteFilterConfig,
181+
ListenerProtocol: plugin.ListenerProtocolHTTP,
182+
Env: env,
183+
Node: node,
184+
Push: push,
200185
}
201186
p.OnOutboundRouteConfiguration(in, out)
202187
}

pilot/pkg/networking/core/v1alpha3/listener_test.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"time"
2121

2222
xdsapi "github.com/envoyproxy/go-control-plane/envoy/api/v2"
23-
"github.com/gogo/protobuf/types"
2423

2524
"istio.io/istio/pilot/pkg/model"
2625
"istio.io/istio/pilot/pkg/networking/core/v1alpha3/fakes"
@@ -29,7 +28,6 @@ import (
2928

3029
const (
3130
wildcardIP = "0.0.0.0"
32-
fake = "fake"
3331
)
3432

3533
var (
@@ -283,19 +281,6 @@ func (p *fakePlugin) OnInboundFilterChains(in *plugin.InputParams) []plugin.Filt
283281
return nil
284282
}
285283

286-
func (p *fakePlugin) GetName() plugin.Name {
287-
return fake
288-
}
289-
290-
func (p *fakePlugin) OnPreComputePerRouteFilterConfig(env *model.Environment, push *model.PushContext) map[string]*types.Struct {
291-
return nil
292-
}
293-
294-
// OnPreComputeMixerPerRouteFilterConfig is called whenever a new push is initialized to set up Mixer Per Route Filter config
295-
func (p *fakePlugin) OnPreComputeMixerPerRouteFilterConfig(env *model.Environment, push *model.PushContext) map[string]*types.Struct {
296-
return nil
297-
}
298-
299284
func isHTTPListener(listener *xdsapi.Listener) bool {
300285
if len(listener.FilterChains) > 0 && len(listener.FilterChains[0].Filters) > 0 {
301286
return listener.FilterChains[0].Filters[0].Name == "envoy.http_connection_manager"

pilot/pkg/networking/plugin/authn/authentication.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,6 @@ func (Plugin) OnOutboundListener(in *plugin.InputParams, mutable *plugin.Mutable
326326
return buildFilter(in, mutable)
327327
}
328328

329-
// OnPreComputeMixerPerRouteFilterConfig is called whenever a new push is initialized to set up Mixer Per Route Filter config
330-
func (Plugin) OnPreComputeMixerPerRouteFilterConfig(env *model.Environment, push *model.PushContext) map[string]*types.Struct {
331-
return nil
332-
}
333-
334329
// OnInboundListener is called whenever a new listener is added to the LDS output for a given service
335330
// Can be used to add additional filters (e.g., mixer filter) or add more stuff to the HTTP connection manager
336331
// on the inbound path
@@ -380,13 +375,3 @@ func (Plugin) OnInboundRouteConfiguration(in *plugin.InputParams, route *xdsapi.
380375
// OnOutboundCluster implements the Plugin interface method.
381376
func (Plugin) OnOutboundCluster(in *plugin.InputParams, cluster *xdsapi.Cluster) {
382377
}
383-
384-
// OnPreComputeMixerPerRouteFilterConfig is called whenever a new push is initialized to set up Per Route Filter config
385-
func (Plugin) OnPreComputePerRouteFilterConfig(env *model.Environment, push *model.PushContext) map[string]*types.Struct {
386-
return nil
387-
}
388-
389-
// GetName returns the Plugin name
390-
func (Plugin) GetName() plugin.Name {
391-
return plugin.Authn
392-
}

pilot/pkg/networking/plugin/authz/rbac.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import (
3636
network_config "github.com/envoyproxy/go-control-plane/envoy/config/filter/network/rbac/v2"
3737
policyproto "github.com/envoyproxy/go-control-plane/envoy/config/rbac/v2alpha"
3838
metadata "github.com/envoyproxy/go-control-plane/envoy/type/matcher"
39-
"github.com/gogo/protobuf/types"
4039

4140
rbacproto "istio.io/api/rbac/v1alpha1"
4241
"istio.io/istio/pilot/pkg/model"
@@ -310,16 +309,6 @@ func (Plugin) OnInboundFilterChains(in *plugin.InputParams) []plugin.FilterChain
310309
return nil
311310
}
312311

313-
// OnPreComputePerRouteFilterConfig is called whenever a new push is initialized to set up Per Route Filter config
314-
func (Plugin) OnPreComputePerRouteFilterConfig(env *model.Environment, push *model.PushContext) map[string]*types.Struct {
315-
return nil
316-
}
317-
318-
// GetName returns the Plugin name
319-
func (Plugin) GetName() plugin.Name {
320-
return plugin.Authz
321-
}
322-
323312
// OnInboundListener is called whenever a new listener is added to the LDS output for a given service
324313
// Can be used to add additional filters (e.g., mixer filter) or add more stuff to the HTTP connection manager
325314
// on the inbound path

pilot/pkg/networking/plugin/health/health.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
hcfilter "github.com/envoyproxy/go-control-plane/envoy/config/filter/http/health_check/v2"
2424
http_conn "github.com/envoyproxy/go-control-plane/envoy/config/filter/network/http_connection_manager/v2"
2525
xdsutil "github.com/envoyproxy/go-control-plane/pkg/util"
26-
"github.com/gogo/protobuf/types"
2726

2827
"istio.io/istio/pilot/pkg/model"
2928
"istio.io/istio/pilot/pkg/networking/plugin"
@@ -142,13 +141,3 @@ func (Plugin) OnOutboundCluster(in *plugin.InputParams, cluster *xdsapi.Cluster)
142141
func (Plugin) OnInboundFilterChains(in *plugin.InputParams) []plugin.FilterChain {
143142
return nil
144143
}
145-
146-
// OnPreComputePerRouteFilterConfig is called whenever a new push is initialized to set up Per Route Filter config
147-
func (Plugin) OnPreComputePerRouteFilterConfig(env *model.Environment, push *model.PushContext) map[string]*types.Struct {
148-
return nil
149-
}
150-
151-
// GetName returns the Plugin name
152-
func (Plugin) GetName() plugin.Name {
153-
return plugin.Health
154-
}

0 commit comments

Comments
 (0)