fix: prevent GatewayNamespace mode from hijacking pre-existing ServiceAccounts and ConfigMaps#9215
fix: prevent GatewayNamespace mode from hijacking pre-existing ServiceAccounts and ConfigMaps#9215yuehaii wants to merge 4 commits into
Conversation
✅ Deploy Preview for cerulean-figolla-1f9435 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4486073b16
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9215 +/- ##
==========================================
- Coverage 74.90% 74.90% -0.01%
==========================================
Files 252 252
Lines 40815 40839 +24
==========================================
+ Hits 30574 30590 +16
- Misses 8158 8164 +6
- Partials 2083 2085 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Can you check the failed e2e test? |
Signed-off-by: hai.yue <20416005+yuehaii@users.noreply.github.com>
…els must match Signed-off-by: hai.yue <20416005+yuehaii@users.noreply.github.com>
…pre-existing and user-managed. we must not block the apply or add an ownerReference to it. Signed-off-by: hai.yue <20416005+yuehaii@users.noreply.github.com>
Signed-off-by: hai.yue <20416005+yuehaii@users.noreply.github.com>
18d0712 to
8a319e5
Compare
|
hi @zirain , good morning. I have fixed the failed test cases. Could you please approve those workflows for verification? |
|
can you add e2e and release notes for this? |
sure. I will add e2e test cases and release notes. |
What type of PR is this?
fix: prevent GatewayNamespace mode from hijacking pre-existing ServiceAccounts and ConfigMaps
What this PR does / why we need it:
In GatewayNamespace mode, when a Gateway is created, Envoy Gateway provisions a ServiceAccount and ConfigMap in the same namespace as the Gateway, using the Gateway's own name as the resource name.
If a resource with that name already existed in the namespace, the reconciler would silently overwrite it via ServerSideApply with client.ForceOwnership, stealing field ownership and injecting a new ownerReference pointing to the Gateway object. When the Gateway was later deleted, Kubernetes garbage collection followed the ownerReference and deleted the pre-existing resource, causing unrelated components to break.
Fixes #9136
Release Notes: Yes