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