Skip to content

Commit

Permalink
add enforcer image configs
Browse files Browse the repository at this point in the history
  • Loading branch information
AmaliMatharaarachchi committed Sep 24, 2024
1 parent 37aad2e commit a34d013
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion adapter/internal/operator/controllers/dp/api_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,7 @@ func (apiReconciler *APIReconciler) getAPIsForSecret(ctx context.Context, obj k8
if err := apiReconciler.client.List(ctx, backendList, &k8client.ListOptions{
FieldSelector: fields.OneTermEqualSelector(secretBackend, utils.NamespacedName(secret).String()),
}); err != nil {
loggers.LoggerAPKOperator.ErrorC(logging.PrintError(logging.Error2621, logging.MINOR, "Unable to find associated Backends for Secret: %s", utils.NamespacedName(secret).String()))
loggers.LoggerAPKOperator.Debugf("Unable to find associated Backends for Secret: %s", utils.NamespacedName(secret).String())
return []reconcile.Request{}
}

Expand Down
4 changes: 1 addition & 3 deletions adapter/internal/operator/gateway-api/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -1097,16 +1097,14 @@ func (t *Translator) processDestination(backendRefContext BackendRefContext,
if backendRef.Weight != nil {
weight = uint32(*backendRef.Weight)
}
loggers.LoggerAPI.Error("amalii", backendRef)

backendNamespace := NamespaceDerefOr(backendRef.Namespace, route.GetNamespace())
if !t.validateBackendRef(backendRefContext, parentRef, route, resources, backendNamespace, routeType) {
loggers.LoggerAPI.Error("amalii")
return nil, weight
}

// Skip processing backends with 0 weight
if weight == 0 {
loggers.LoggerAPI.Error("amalii")
return nil, weight
}

Expand Down
18 changes: 8 additions & 10 deletions adapter/internal/operator/synchronizer/gateway_synchronizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,14 @@ func AddOrUpdateGateway(gatewayState GatewayState, state string) (string, error)
xds.GenerateGlobalClusters(gateway.Name)
}
listeners, clusters, routes, endpoints, apis := xds.GenerateEnvoyResoucesForGateway(gateway.Name)
if !config.ReadConfigs().Adapter.EnableGatewayClassController {
xds.GenerateInterceptorClusters(gateway.Name, gwReqICluster, gwReqIAddresses, gwResICluster, gwResIAddresses)
xds.UpdateGatewayCache(gateway, resolvedListenerCerts, gwLuaScript, customRateLimitPolicies)
loggers.LoggerAPKOperator.Debugf("listeners: %v", listeners)
loggers.LoggerAPKOperator.Debugf("clusters: %v", clusters)
loggers.LoggerAPKOperator.Debugf("routes: %v", routes)
loggers.LoggerAPKOperator.Debugf("endpoints: %v", endpoints)
loggers.LoggerAPKOperator.Debugf("apis: %v", apis)
xds.UpdateXdsCacheWithLock(gateway.Name, endpoints, clusters, routes, listeners)
}
xds.GenerateInterceptorClusters(gateway.Name, gwReqICluster, gwReqIAddresses, gwResICluster, gwResIAddresses)
xds.UpdateGatewayCache(gateway, resolvedListenerCerts, gwLuaScript, customRateLimitPolicies)
loggers.LoggerAPKOperator.Debugf("listeners: %v", listeners)
loggers.LoggerAPKOperator.Debugf("clusters: %v", clusters)
loggers.LoggerAPKOperator.Debugf("routes: %v", routes)
loggers.LoggerAPKOperator.Debugf("endpoints: %v", endpoints)
loggers.LoggerAPKOperator.Debugf("apis: %v", apis)
xds.UpdateXdsCacheWithLock(gateway.Name, endpoints, clusters, routes, listeners)
xds.UpdateEnforcerApis(gateway.Name, apis, "")
return "", nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ data:
commonControllerHost = "{{ template "apk-helm.resource.prefix" . }}-common-controller-service.{{ .Release.Namespace }}.svc"
enforcerServerName = "{{ template "apk-helm.resource.prefix" . }}-enforcer-service.{{ .Release.Namespace }}.svc"
{{- if and .Values.wso2.apk.dp.gatewayRuntime.deployment .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs }}
enforcerImage = "{{ .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.image | default "apk-enforcer:1.2.0-SNAPSHOT" }}"
enforcerImagePullPolicy = "{{ .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.imagePullPolicy | default "Always" }}"
{{- if and .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.javaOpts }}
javaOpts = "{{ .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.javaOpts }}"
{{- end }}
Expand Down

0 comments on commit a34d013

Please sign in to comment.