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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 29, 2025

conformance test report

apiVersion: gateway.networking.k8s.io/v1
date: "2025-07-30T02:31:40Z"
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 29, 2025

conformance test report - apisix mode

apiVersion: gateway.networking.k8s.io/v1
date: "2025-07-30T02:29:05Z"
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:
    - HTTPRouteInvalidBackendRefUnknownKind
    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 29, 2025

conformance test report - apisix-standalone mode

apiVersion: gateway.networking.k8s.io/v1
date: "2025-07-30T02:27:58Z"
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:
    - HTTPRouteInvalidBackendRefUnknownKind
    result: failure
    skippedTests:
    - HTTPRouteHTTPSListener
    statistics:
      Failed: 1
      Passed: 31
      Skipped: 1
  name: GATEWAY-HTTP
  summary: Core tests failed with 1 test failures.

@ronething ronething changed the title feat: do not watch gateway api when disable feat: do not setup gateway api related controller when disable Jul 29, 2025
Signed-off-by: Ashing Zheng <[email protected]>
@ronething ronething marked this pull request as ready for review July 29, 2025 09:32
@ronething ronething changed the title feat: do not setup gateway api related controller when disable feat: skip setup gateway api related controllers when cluster not support Jul 29, 2025
Signed-off-by: Ashing Zheng <[email protected]>
@ronething ronething requested a review from Copilot July 29, 2025 09:41
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 implements conditional controller registration based on cluster API resource availability, specifically skipping Gateway API controllers when the cluster doesn't support these resources.

  • Adds utility functions to detect API resource availability in the cluster
  • Refactors controller setup to conditionally register Gateway API controllers
  • Comments out ADC_VERSION in CI workflows

Reviewed Changes

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

File Description
pkg/utils/cluster.go New utility functions for API resource detection using discovery client
internal/manager/controllers.go Refactored controller setup with conditional registration logic
.github/workflows/apisix-e2e-test.yml Comments out ADC_VERSION environment variable
.github/workflows/apisix-conformance-test.yml Comments out ADC_VERSION environment variable

Signed-off-by: Ashing Zheng <[email protected]>
var controllers []Controller

// Gateway API Controllers - conditional registration based on API availability
if utils.HasAPIResource(mgr, &gatewayv1.GatewayClass{}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The logic here is basically similar, we can write it like this:

	controllers := []Controller{}
	for resource, controller := range map[client.Object]Controller{
		&gatewayv1.GatewayClass{}: &controller.GatewayClassReconciler{
			Client:  mgr.GetClient(),
			Scheme:  mgr.GetScheme(),
			Updater: updater,
		},
		&gatewayv1.Gateway{}: &controller.GatewayReconciler{
			Client:  mgr.GetClient(),
			Scheme:  mgr.GetScheme(),
			Updater: updater,
		},
	} {
		if !utils.HasAPIResource(mgr, resource) {
			// log
		} else {
			controllers = append(controllers, controller)
		}
	}

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 requested a review from AlinsRan July 30, 2025 02:20
@ronething ronething merged commit e61d276 into release-v2-dev Jul 30, 2025
21 checks passed
@ronething ronething deleted the feat/fallbackapi branch July 30, 2025 04: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.

3 participants