Skip to content

Conversation

@ronething
Copy link
Contributor

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

Signed-off-by: Ashing Zheng <[email protected]>
Signed-off-by: Ashing Zheng <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Jul 30, 2025

conformance test report - apisix-standalone mode

apiVersion: gateway.networking.k8s.io/v1
date: "2025-08-01T07:10:48Z"
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 Jul 30, 2025

conformance test report - apisix mode

apiVersion: gateway.networking.k8s.io/v1
date: "2025-08-01T07:12: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:
    failedTests:
    - HTTPRouteMatchingAcrossRoutes
    result: failure
    skippedTests:
    - HTTPRouteHTTPSListener
    statistics:
      Failed: 1
      Passed: 31
      Skipped: 1
  name: GATEWAY-HTTP
  summary: Core tests failed with 1 test failures.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 30, 2025

conformance test report

apiVersion: gateway.networking.k8s.io/v1
date: "2025-08-01T07:14:26Z"
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.

Signed-off-by: Ashing Zheng <[email protected]>
@ronething ronething marked this pull request as ready for review July 31, 2025 04:58
Signed-off-by: Ashing Zheng <[email protected]>
@ronething ronething requested a review from Copilot July 31, 2025 08:37
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 fallback support for Kubernetes 1.18 clusters by implementing compatibility with the Endpoints API when EndpointSlice API is not available. The implementation detects EndpointSlice API support at runtime and gracefully falls back to using Endpoints API for service discovery.

Key Changes:

  • Added runtime detection of EndpointSlice API availability and fallback to Endpoints API
  • Created utility function to convert Endpoints to EndpointSlice format for internal consistency
  • Updated RBAC permissions to include endpoints resource access

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
pkg/utils/endpoints.go New utility function to convert Endpoints objects to EndpointSlice format
pkg/utils/cluster.go Updated API resource detection to use controller-runtime's apiutil
internal/controller/*.go Added EndpointSlice support detection and conditional watching/processing
test/e2e/framework/manifests/ingress.yaml Added endpoints RBAC permissions
config/rbac/role.yaml Updated RBAC role to include endpoints access
test/e2e/crds/v2/route.go Refactored test assertion method call

Signed-off-by: Ashing Zheng <[email protected]>
Signed-off-by: Ashing Zheng <[email protected]>
Signed-off-by: Ashing Zheng <[email protected]>
predicate.Or(
predicate.GenerationChangedPredicate{},
predicate.AnnotationChangedPredicate{},
predicate.NewPredicateFuncs(TypePredicate[*corev1.Endpoints]()),
Copy link
Contributor

Choose a reason for hiding this comment

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

When supportsEndpointSlice is true, it is redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.

terr = err
continue
// Conditionally collect EndpointSlice or Endpoints based on cluster API support
if r.supportsEndpointSlice {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this logic be abstracted into a function for reuse.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.


for i, subset := range ep.Subsets {
// Create ports array
var ports []discoveryv1.EndpointPort
Copy link
Contributor

Choose a reason for hiding this comment

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

Can be pre allocated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated.

Signed-off-by: Ashing Zheng <[email protected]>
@ronething ronething merged commit 33d3cac into release-v2-dev Aug 1, 2025
21 checks passed
@ronething ronething deleted the feat/support_endpoints_fallback branch August 1, 2025 08:04
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