Skip to content

Conversation

@fgiudici
Copy link
Member

@fgiudici fgiudici commented Nov 19, 2025

What this PR does / why we need it:

This PR reworks the life-cycle of the Kong resources generated by the Hybrid Gateway controller.
With the introduction of #2566 the Kong resources generated from HTTPRoutes can be shared by different HTTPRoutes.
This requires to drop the single Owner reference in the generated Kong resources in favor of a multi-ownership strategy.

This PR drops the Owner references from the generated resources and adds a tracking annotation where all the HTTPRoutes sharing the resource will add themselves.
A generated resource is removed only when no more HTTPRoutes appear in the tracking annotation.

The tracking annotation is:
gateway-operator.konghq.com/hybrid-routes

Which issue this PR fixes

Fixes #2683

Special notes for your reviewer:

The current code has some duplication that can be avoided with better factorization.
This is left for #2684 and the plan is to address it once all the functionality is there (i.e., after #2685).

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect significant changes

@fgiudici fgiudici changed the title Fg/2520 hg generate resources lifecycle feat(hybridgateway): rework generated resources lifecycle Nov 19, 2025
@fgiudici fgiudici force-pushed the fg/2520-hg-generate_resources_lifecycle branch 2 times, most recently from 5ae8d61 to 80b4562 Compare November 20, 2025 13:48
@fgiudici fgiudici marked this pull request as ready for review November 20, 2025 18:32
@fgiudici fgiudici requested a review from a team as a code owner November 20, 2025 18:32
@fgiudici fgiudici force-pushed the fg/2520-hg-generate_resources_lifecycle branch from 34ba2c0 to 733e6a4 Compare November 21, 2025 08:22

// Remove finalizer
controllerutil.RemoveFinalizer(obj, routeconst.RouteFinalizer)
if err := r.Update(ctx, obj); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

Aditto about Update

it also performs (debug) logging.

Signed-off-by: Francesco Giudici <[email protected]>
i.e., hybrid-routes

Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
Signed-off-by: Francesco Giudici <[email protected]>
@fgiudici fgiudici force-pushed the fg/2520-hg-generate_resources_lifecycle branch from 733e6a4 to 1610db1 Compare November 21, 2025 17: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.

HybridGateway: rework generated resources ownership

3 participants