-
Notifications
You must be signed in to change notification settings - Fork 2
feat: support apisix plugin config #166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing <[email protected]>
…t_apisix_plugin_config Signed-off-by: ashing <[email protected]>
conformance test reportapiVersion: gateway.networking.k8s.io/v1
date: "2025-06-18T08:21:57Z"
gatewayAPIChannel: standard
gatewayAPIVersion: v1.2.0
implementation:
contact: null
organization: APISIX
project: apisix-ingress-controller
url: https://github.com/apache/apisix-ingress-controller.git
version: v2.0.0
kind: ConformanceReport
mode: default
profiles:
- core:
result: partial
skippedTests:
- HTTPRouteHTTPSListener
statistics:
Failed: 0
Passed: 32
Skipped: 1
name: GATEWAY-HTTP
summary: Core tests partially succeeded with 1 test skips. |
conformance test reportapiVersion: gateway.networking.k8s.io/v1
date: "2025-06-18T08:22:29Z"
gatewayAPIChannel: standard
gatewayAPIVersion: v1.2.0
implementation:
contact: null
organization: APISIX
project: apisix-ingress-controller
url: https://github.com/apache/apisix-ingress-controller.git
version: v2.0.0
kind: ConformanceReport
mode: default
profiles:
- core:
failedTests:
- HTTPRouteCrossNamespace
result: failure
skippedTests:
- HTTPRouteHTTPSListener
statistics:
Failed: 1
Passed: 31
Skipped: 1
name: GATEWAY-HTTP
summary: Core tests failed with 1 test failures. |
Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the ApisixPluginConfig CRD throughout the controller stack, enabling plugin configurations to be referenced, indexed, and applied in translated APISIX routes.
- Extend
TranslateContextto holdApisixPluginConfigsand wire them into the translation pipeline - Refactor the ADC translator (
TranslateApisixRoute) to load plugins from both route‐level and PluginConfig resources - Implement a new
ApisixPluginConfigReconciler, register watches, and index routes by PluginConfig references
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/provider/provider.go | Added ApisixPluginConfigs field to TranslateContext |
| internal/provider/adc/translator/apisixroute.go | Refactored route translation to build timeouts, plugins, etc. |
| internal/manager/controllers.go | Registered the ApisixPluginConfigReconciler |
| internal/controller/utils.go | Introduced KindApisixPluginConfig constant |
| internal/controller/indexer/indexer.go | Added indexer for PluginConfig references |
| internal/controller/apisixroute_controller.go | Updated watcher and processing to include PluginConfig refs |
| internal/controller/apisixpluginconfig_controller.go | New reconciliation logic for ApisixPluginConfig |
Comments suppressed due to low confidence (2)
internal/controller/indexer/indexer.go:41
- [nitpick] Consider renaming this constant to ApisixPluginConfigIndexRef to clearly indicate it indexes ApisixPluginConfig resources and maintain consistency with other index constants.
PluginConfigIndexRef = "pluginConfigRefs"
internal/provider/adc/translator/apisixroute.go:48
- The new translateHTTPRule helper encapsulates critical routing and plugin logic. Consider adding unit tests to validate its behavior across different PluginConfig and timeout scenarios.
func (t *Translator) translateHTTPRule(tctx *provider.TranslateContext, ar *apiv2.ApisixRoute, rule apiv2.ApisixRouteHTTP, ruleIndex int) (*adc.Service, error) {
Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing <[email protected]>
| if client.IgnoreNotFound(err) == nil { | ||
| pc.Namespace = req.Namespace | ||
| pc.Name = req.Name | ||
| pc.TypeMeta = metav1.TypeMeta{ | ||
| Kind: KindApisixPluginConfig, | ||
| APIVersion: apiv2.GroupVersion.String(), | ||
| } | ||
|
|
||
| return ctrl.Result{}, nil | ||
| } | ||
| return ctrl.Result{}, err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if client.IgnoreNotFound(err) == nil { | |
| pc.Namespace = req.Namespace | |
| pc.Name = req.Name | |
| pc.TypeMeta = metav1.TypeMeta{ | |
| Kind: KindApisixPluginConfig, | |
| APIVersion: apiv2.GroupVersion.String(), | |
| } | |
| return ctrl.Result{}, nil | |
| } | |
| return ctrl.Result{}, err | |
| return ctrl.Result{}, client.IgnoreNotFound(err) |
Signed-off-by: ashing <[email protected]>
Signed-off-by: ashing [email protected]
Type of change:
What this PR does / why we need it:
Pre-submission checklist: