@@ -84,11 +84,12 @@ type StartConfig struct {
84
84
// It is intended to be run in a goroutine as the function will block until the supplied
85
85
// context is cancelled
86
86
type ControllerBuilder struct {
87
- proxySyncer * proxy_syncer.ProxySyncer
88
- inputChannels * proxy_syncer.GatewayInputChannels
89
- cfg StartConfig
90
- k8sGwExtensions ext.K8sGatewayExtensions
91
- mgr ctrl.Manager
87
+ proxySyncer * proxy_syncer.ProxySyncer
88
+ inputChannels * proxy_syncer.GatewayInputChannels
89
+ cfg StartConfig
90
+ k8sGwExtensions ext.K8sGatewayExtensions
91
+ mgr ctrl.Manager
92
+ allowedGatewayClasses sets.Set [string ]
92
93
}
93
94
94
95
func NewControllerBuilder (ctx context.Context , cfg StartConfig ) (* ControllerBuilder , error ) {
@@ -170,6 +171,8 @@ func NewControllerBuilder(ctx context.Context, cfg StartConfig) (*ControllerBuil
170
171
return nil , err
171
172
}
172
173
174
+ allowedGatewayClasses := sets .New (append (cfg .SetupOpts .ExtraGatewayClasses , wellknown .GatewayClassName )... )
175
+
173
176
// Create the proxy syncer for the Gateway API resources
174
177
setupLog .Info ("initializing proxy syncer" )
175
178
proxySyncer := proxy_syncer .NewProxySyncer (
@@ -190,6 +193,7 @@ func NewControllerBuilder(ctx context.Context, cfg StartConfig) (*ControllerBuil
190
193
cfg .SyncerExtensions ,
191
194
cfg .GlooStatusReporter ,
192
195
cfg .SetupOpts .ProxyReconcileQueue ,
196
+ allowedGatewayClasses ,
193
197
)
194
198
proxySyncer .Init (ctx , cfg .Debugger )
195
199
if err := mgr .Add (proxySyncer ); err != nil {
@@ -198,11 +202,12 @@ func NewControllerBuilder(ctx context.Context, cfg StartConfig) (*ControllerBuil
198
202
}
199
203
200
204
return & ControllerBuilder {
201
- proxySyncer : proxySyncer ,
202
- inputChannels : inputChannels ,
203
- cfg : cfg ,
204
- k8sGwExtensions : k8sGwExtensions ,
205
- mgr : mgr ,
205
+ proxySyncer : proxySyncer ,
206
+ inputChannels : inputChannels ,
207
+ cfg : cfg ,
208
+ k8sGwExtensions : k8sGwExtensions ,
209
+ mgr : mgr ,
210
+ allowedGatewayClasses : allowedGatewayClasses ,
206
211
}, nil
207
212
}
208
213
@@ -246,7 +251,7 @@ func (c *ControllerBuilder) Start(ctx context.Context) error {
246
251
247
252
gwCfg := GatewayConfig {
248
253
Mgr : c .mgr ,
249
- GWClasses : sets . New ( append ( c . cfg . SetupOpts . ExtraGatewayClasses , wellknown . GatewayClassName ) ... ) ,
254
+ GWClasses : c . allowedGatewayClasses ,
250
255
ControllerName : wellknown .GatewayControllerName ,
251
256
AutoProvision : AutoProvision ,
252
257
ControlPlane : deployer.ControlPlaneInfo {
0 commit comments