Skip to content

Commit

Permalink
chore: set mergedGateways in translator runner
Browse files Browse the repository at this point in the history
Signed-off-by: Karol Szwaj <karol.szwaj@gmail.com>
  • Loading branch information
cnvergence committed Mar 18, 2024
1 parent 2161064 commit 4e92b0c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/gatewayapi/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func irTLSCACertName(namespace, name string) string {
return fmt.Sprintf("%s/%s/%s", namespace, name, caCertKey)
}

func isMergeGatewaysEnabled(resources *Resources) bool {
func IsMergeGatewaysEnabled(resources *Resources) bool {
return resources.EnvoyProxy != nil && resources.EnvoyProxy.Spec.MergeGateways != nil && *resources.EnvoyProxy.Spec.MergeGateways
}

Expand Down
1 change: 1 addition & 0 deletions internal/gatewayapi/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (r *Runner) subscribeAndTranslate(ctx context.Context) {
GlobalRateLimitEnabled: r.EnvoyGateway.RateLimit != nil,
EnvoyPatchPolicyEnabled: r.EnvoyGateway.ExtensionAPIs != nil && r.EnvoyGateway.ExtensionAPIs.EnableEnvoyPatchPolicy,
Namespace: r.Namespace,
MergeGateways: gatewayapi.IsMergeGatewaysEnabled(resources),
}

// If an extension is loaded, pass its supported groups/kinds to the translator
Expand Down
3 changes: 1 addition & 2 deletions internal/gatewayapi/translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ func (t *Translator) InitIRs(gateways []*GatewayContext, resources *Resources) (
annotations := infrastructureAnnotations(gateway.Gateway)
gwInfraIR.Proxy.GetProxyMetadata().Annotations = annotations

if isMergeGatewaysEnabled(resources) {
t.MergeGateways = true
if t.MergeGateways {
irKey = string(t.GatewayClassName)

maps.Copy(labels, GatewayClassOwnerLabel(string(t.GatewayClassName)))
Expand Down

0 comments on commit 4e92b0c

Please sign in to comment.