Skip to content

Conversation

@dspo
Copy link
Contributor

@dspo dspo commented Jun 17, 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:

Support ApisixRoute resolveGranularity.

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-17T03:44:07Z"
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.

@dspo dspo requested a review from Copilot June 17, 2025 03:22

This comment was marked as outdated.

@dspo dspo requested a review from Copilot June 17, 2025 03:33
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 introduces support for ApisixRoute resolveGranularity, allowing the controller and translator to distinguish between "service" and "endpoint" granularity for backend resolution. Key changes include:

  • Modifications to end-to-end tests to verify both a service-not-found case and proper resolveGranularity behavior.
  • Updates to the translator to add distinct functions for handling backend resolution for service and endpoint granularity.
  • Adjustments to the ApisixRoute controller to log errors and continue processing in place of returning errors for certain service-related issues.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
test/e2e/framework/assertion.go Removed a type check on the object in APIv2MustHaveCondition to align with the new resolveGranularity support.
test/e2e/apisix/route.go Added new test cases for service-not-found and proper resolveGranularity handling, and updated test imports.
internal/provider/adc/translator/apisixroute.go Introduced two new functions for translating backends based on the resolveGranularity field and adjusted utils usage.
internal/controller/apisixroute_controller.go Modified error-handling to log errors and continue, rather than immediately returning errors for service issues.
Comments suppressed due to low confidence (2)

internal/controller/apisixroute_controller.go:224

  • Consider reviewing whether logging the error and continuing when a service does not have a ClusterIP is the desired behavior, as this might hide configuration issues that should be addressed.
if backend.ResolveGranularity == "service" && service.Spec.ClusterIP == "" {

internal/controller/apisixroute_controller.go:213

  • Verify that using client.IgnoreNotFound to skip processing for a missing service is in line with the intended behavior and will not mask underlying issues that could be critical during runtime.
if err := client.IgnoreNotFound(err); err == nil {

@github-actions
Copy link
Contributor

conformance test report

apiVersion: gateway.networking.k8s.io/v1
date: "2025-06-17T03:47:36Z"
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.

var (
upNodes adc.UpstreamNodes
)
if backend.ResolveGranularity == "service" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does "service" consider defining a constant?

@dspo dspo merged commit 2b28953 into release-v2-dev Jun 17, 2025
13 of 15 checks passed
@dspo dspo deleted the feat/apisixroute-resolve-granularity branch June 23, 2025 07:28
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.

4 participants