Skip to content

Conversation

syedazeez337
Copy link
Contributor

@syedazeez337 syedazeez337 commented May 1, 2025

Description

This PR fixes an issue where the Gateway reconciler was not checking if the parentRef was a Gateway before checking if the name and namespace match. This caused GAMMA HTTPRoutes with a Service parentRef to be incorrectly attached to Gateways with the same name.

The fix adds a check to ensure that the parentRef's Group and Kind match the Gateway API group and Gateway kind before proceeding with name and namespace matching.

How has this been tested?

Added a new test case to verify that a GAMMA Service with the same name as a Gateway is not matched by the Gateway reconciler. All existing tests continue to pass.

Fixes: #39193

Checklist

  • I have signed all my commits with DCO
  • I have added tests to prove my fix is effective
  • I have run the existing tests which continue to pass
  • This change requires a documentation update: No

@syedazeez337 syedazeez337 requested review from a team as code owners May 1, 2025 07:12
@syedazeez337 syedazeez337 requested review from joamaki and derailed May 1, 2025 07:12
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label May 1, 2025
@github-actions github-actions bot added cilium-cli This PR contains changes related with cilium-cli kind/community-contribution This was a contribution made by a community member. labels May 1, 2025
@syedazeez337 syedazeez337 marked this pull request as draft May 1, 2025 07:13
This commit fixes an issue where the Gateway reconciler was not checking if the parentRef was a Gateway before checking if the name and namespace match. This caused GAMMA HTTPRoutes with a Service parentRef to be incorrectly attached to Gateways with the same name.

Fixes: cilium#39193
Signed-off-by: Syed Azeez <syedazeez337@gmail.com>
@syedazeez337 syedazeez337 force-pushed the fix-gamma-httproute-parentref-matching branch from e051884 to 83a775e Compare May 1, 2025 07:20
@syedazeez337 syedazeez337 marked this pull request as ready for review May 1, 2025 07:30
@qmonnet qmonnet added release-note/bug This PR fixes an issue in a previous release of Cilium. feature/k8s-gateway-api labels May 1, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot removed the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label May 1, 2025
@qmonnet
Copy link
Member

qmonnet commented May 1, 2025

/test

@qmonnet qmonnet removed the request for review from a team May 1, 2025 10:22
@qmonnet qmonnet removed their request for review May 1, 2025 10:22
@syedazeez337
Copy link
Contributor Author

Hello reviewers, I have gone through the logs of the failed checks, It doesn't seem to be related to my code changes. Let me know what the issue could be.

@aanm aanm removed request for a team, joamaki, derailed, ysksuzuki, aanm and christarazi May 2, 2025 08:11
@aanm aanm enabled auto-merge May 2, 2025 08:12
Copy link
Contributor

@youngnick youngnick left a comment

Choose a reason for hiding this comment

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

Hah, I was working on this as well, this is better than the way I thought of (fixing isAttachable). Nice work!

@aanm aanm added this pull request to the merge queue May 7, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label May 7, 2025
@youngnick youngnick added the needs-backport/1.17 This PR / issue needs backporting to the v1.17 branch label May 7, 2025
Merged via the queue into cilium:main with commit d18a978 May 7, 2025
66 checks passed
@sayboras sayboras mentioned this pull request May 7, 2025
9 tasks
@sayboras sayboras added backport-pending/1.17 The backport for Cilium 1.17.x for this PR is in progress. and removed needs-backport/1.17 This PR / issue needs backporting to the v1.17 branch labels May 7, 2025
@github-actions github-actions bot added backport-done/1.17 The backport for Cilium 1.17.x for this PR is done. and removed backport-pending/1.17 The backport for Cilium 1.17.x for this PR is in progress. labels May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-done/1.17 The backport for Cilium 1.17.x for this PR is done. cilium-cli This PR contains changes related with cilium-cli feature/k8s-gateway-api kind/community-contribution This was a contribution made by a community member. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gateways with the same name as a GAMMA service incorrectly attach GAMMA HTTPRoutes
5 participants