Skip to content

Commit

Permalink
OSSM-4627 Add option to disable the GatewayClass controller (maistra#834
Browse files Browse the repository at this point in the history
)
  • Loading branch information
luksa committed Aug 16, 2023
1 parent e466ba0 commit 35206ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
16 changes: 9 additions & 7 deletions pilot/pkg/config/kube/gateway/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,15 @@ func (c *Controller) Run(stop <-chan struct{}) {
if c.namespaces == nil {
return
}
go func() {
if c.waitForCRD(gvk.GatewayClass, stop) {
gcc := NewClassController(c.client)
c.client.RunAndWait(stop)
gcc.Run(stop)
}
}()
if features.EnableGatewayAPIGatewayClassController {
go func() {
if c.waitForCRD(gvk.GatewayClass, stop) {
gcc := NewClassController(c.client)
c.client.RunAndWait(stop)
gcc.Run(stop)
}
}()
}
}

func (c *Controller) HasSynced() bool {
Expand Down
3 changes: 3 additions & 0 deletions pilot/pkg/features/pilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ var (
EnableGatewayAPIDeploymentController = env.Register("PILOT_ENABLE_GATEWAY_API_DEPLOYMENT_CONTROLLER", true,
"If this is set to true, gateway-api resources will automatically provision in cluster deployment, services, etc").Get()

EnableGatewayAPIGatewayClassController = env.Register("PILOT_ENABLE_GATEWAY_API_GATEWAYCLASS_CONTROLLER", true,
"If this is set to true, istiod will ensure that the default GatewayClass always exists").Get()

ClusterName = env.Register("CLUSTER_ID", "Kubernetes",
"Defines the cluster and service registry that this Istiod instance is belongs to").Get()

Expand Down

0 comments on commit 35206ba

Please sign in to comment.