Skip to content

Conversation

@ronething
Copy link
Contributor

@ronething ronething commented Jun 17, 2025

Signed-off-by: ashing [email protected]

Type of change:

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches
  • Documentation
  • Refactor
  • Chore
  • CI/CD or Tests

What this PR does / why we need it:

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@github-actions
Copy link
Contributor

github-actions bot commented Jun 17, 2025

conformance test report

apiVersion: 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.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 17, 2025

conformance test report

apiVersion: 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]>
@ronething ronething marked this pull request as ready for review June 17, 2025 11:14
@ronething ronething requested a review from Copilot June 18, 2025 02:36
Copy link
Contributor

Copilot AI left a 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 TranslateContext to hold ApisixPluginConfigs and 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]>
@ronething ronething requested a review from dspo June 18, 2025 07:16
Signed-off-by: ashing <[email protected]>
Comment on lines +70 to +80
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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]>
@ronething ronething merged commit d4f7530 into release-v2-dev Jun 18, 2025
13 checks passed
@ronething ronething deleted the feat/support_apisix_plugin_config branch June 18, 2025 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants