Skip to content

Conversation

@dspo
Copy link
Contributor

@dspo dspo commented Apr 29, 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:

Introduce a finalizer to prevent deletion of GatewayClasses still in use by Gateways, and implement corresponding e2e tests to validate the protection mechanism and proper removal flow.

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

Introduce a finalizer to prevent deletion of GatewayClasses still in use by Gateways, and implement corresponding e2e tests to validate the protection mechanism and proper removal flow.
@dspo dspo requested a review from AlinsRan April 29, 2025 00:51
Update the warning message to use "used" instead of "in using" for better clarity and correctness when indicating that a GatewayClass is still referenced by Gateways.
@github-actions
Copy link
Contributor

github-actions bot commented Apr 29, 2025

conformance test report

apiVersion: gateway.networking.k8s.io/v1
date: "2025-04-29T06:49:03Z"
gatewayAPIChannel: standard
gatewayAPIVersion: v1.2.0
implementation:
  contact: null
  organization: API7
  project: api7-ingress-controller
  url: https://github.com/api7/api7-ingress-controller.git
  version: v2.0.0
kind: ConformanceReport
mode: default
profiles:
- core:
    result: partial
    skippedTests:
    - GatewayInvalidTLSConfiguration
    - GatewaySecretInvalidReferenceGrant
    - GatewaySecretMissingReferenceGrant
    - GatewaySecretReferenceGrantAllInNamespace
    - GatewaySecretReferenceGrantSpecific
    - HTTPRouteExactPathMatching
    - HTTPRouteHTTPSListener
    - HTTPRouteHeaderMatching
    - HTTPRouteHostnameIntersection
    - HTTPRouteInvalidBackendRefUnknownKind
    - HTTPRouteInvalidCrossNamespaceBackendRef
    - HTTPRouteInvalidCrossNamespaceParentRef
    - HTTPRouteInvalidNonExistentBackendRef
    - HTTPRouteInvalidParentRefNotMatchingSectionName
    - HTTPRouteInvalidReferenceGrant
    - HTTPRouteListenerHostnameMatching
    - HTTPRouteMatching
    - HTTPRouteMatchingAcrossRoutes
    - HTTPRoutePartiallyInvalidViaInvalidReferenceGrant
    - HTTPRouteReferenceGrant
    - HTTPRouteRequestHeaderModifier
    - HTTPRouteWeight
    statistics:
      Failed: 0
      Passed: 11
      Skipped: 22
  name: GATEWAY-HTTP
  summary: Core tests partially succeeded with 22 test skips.

} else {
if controllerutil.ContainsFinalizer(gc, FinalizerGatewayClassProtection) {
var gatewayList gatewayv1.GatewayList
if err := r.List(ctx, &gatewayList); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Here, indexes can be added to the gateway to speed up queries.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

resolve this with a PR #120

@dspo dspo merged commit 100bbc8 into release-v2-dev Apr 29, 2025
8 checks passed
@dspo dspo mentioned this pull request Apr 30, 2025
12 tasks
@AlinsRan AlinsRan deleted the chore/gateway-class-finalizer branch May 8, 2025 07:21
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