Skip to content

feat: implement reconciler for apisixroute #164

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

Open
wants to merge 9 commits into
base: release-v2-dev
Choose a base branch
from

Conversation

dspo
Copy link
Contributor

@dspo dspo commented Jun 12, 2025

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:

实现 ApisixRoute Reconciler

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

@dspo dspo closed this Jun 13, 2025
@dspo dspo reopened this Jun 13, 2025
@dspo dspo marked this pull request as ready for review June 13, 2025 07:02
Copy link

github-actions bot commented Jun 13, 2025

conformance test report

apiVersion: gateway.networking.k8s.io/v1
date: "2025-06-13T08:28:23Z"
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.

Copy link

github-actions bot commented Jun 13, 2025

conformance test report

apiVersion: gateway.networking.k8s.io/v1
date: "2025-06-13T08:33:54Z"
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.

@dspo dspo requested a review from Copilot June 13, 2025 07:57
@dspo dspo changed the title (WIP)feat: implement reconciler for apisixroute feat: implement reconciler for apisixroute Jun 13, 2025
Copy link
Contributor

@Copilot 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

Adds support for ApisixRoute reconciliation by unifying status updates, introducing new indexers, and expanding the v2 API types and CRD schemas.

  • Switch all controllers to use utils.NamespacedName for status updates
  • Add ApisixRoute service/secret indexers and their helper functions
  • Define new v2 API types for ApisixRoute (including Exprs conversion), status helper, shared constants, and update CRD schemas

Reviewed Changes

Copilot reviewed 37 out of 37 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/controller/policies.go Use utils.NamespacedName instead of local helper
internal/controller/ingress_controller.go Use utils.NamespacedName instead of local helper
internal/controller/indexer/indexer.go Add setupApisixRouteIndexer and index functions for routes
internal/controller/httproutepolicy.go Use utils.NamespacedName for HTTPRoutePolicy status updates
internal/controller/httproute_controller.go Use utils.NamespacedName for HTTPRoute status updates
internal/controller/gatewayclass_congroller.go Use utils.NamespacedName for GatewayClass updates
internal/controller/gateway_controller.go Use utils.NamespacedName for Gateway updates
internal/controller/consumer_controller.go Use utils.NamespacedName for Consumer status updates
internal/controller/apisixglobalrule_controller.go Update condition constants and use utils.NamespacedName
docs/crd/api.md Document new ApisixRouteHTTPMatchExprs and update links
config/crd/bases/apisix.apache.org_apisixroutes.yaml Remove now-optional fields from required lists
config/crd/bases/apisix.apache.org_apisixpluginconfigs.yaml Update the status field description
api/v2/zz_generated.deepcopy.go Regenerate DeepCopy methods for new Exprs type
api/v2/status.go Add GetStatus helper for v2 objects
api/v2/shared_types.go Introduce shared route and plugin constants
api/v2/groupversion_info.go Add Is(obj) helper for group-version checking
api/v2/apisixroute_types.go Add ApisixRouteHTTPMatchExprs type and ToVars converter
api/v2/apisixpluginconfig_types.go Change ApisixPluginConfigStatus to alias ApisixStatus
api/v2/apisixglobalrule_types.go Remove redundant deepcopy file and tweak init registration
Comments suppressed due to low confidence (3)

internal/controller/gatewayclass_congroller.go:1

  • The filename contains a typo (congroller). Rename to gatewayclass_controller.go for consistency and clarity.
gatewayclass_congroller.go

api/v2/apisixroute_types.go:234

  • The new ToVars conversion function contains complex logic for multiple operators and scopes. Consider adding unit tests to cover each branch and error condition.
func (exprs ApisixRouteHTTPMatchExprs) ToVars() (result adc.Vars, err error) {

config/crd/bases/apisix.apache.org_apisixpluginconfigs.yaml:77

  • [nitpick] The status description no longer references ApisixPluginConfigStatus. Consider updating it to mention plugin config or align it with the alias for clarity.
description: ApisixStatus is the status report for Apisix ingress Resources

@dspo dspo requested a review from ronething June 13, 2025 08:16
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.

1 participant