Skip to content

fix: avoid appending same Backends twice to resource map#6506

Merged
zirain merged 4 commits intoenvoyproxy:mainfrom
zirain:process-backend
Jul 15, 2025
Merged

fix: avoid appending same Backends twice to resource map#6506
zirain merged 4 commits intoenvoyproxy:mainfrom
zirain:process-backend

Conversation

@zirain
Copy link
Copy Markdown
Member

@zirain zirain commented Jul 11, 2025

supersede #6021

@zirain zirain requested a review from a team as a code owner July 11, 2025 00:51
@codecov
Copy link
Copy Markdown

codecov bot commented Jul 11, 2025

Codecov Report

Attention: Patch coverage is 13.04348% with 20 lines in your changes missing coverage. Please review.

Project coverage is 70.75%. Comparing base (dba756e) to head (089601f).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
internal/provider/kubernetes/controller.go 9.09% 19 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (13.04%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6506      +/-   ##
==========================================
+ Coverage   70.68%   70.75%   +0.07%     
==========================================
  Files         220      220              
  Lines       37722    37755      +33     
==========================================
+ Hits        26662    26714      +52     
+ Misses       9495     9485      -10     
+ Partials     1565     1556       -9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zirain zirain force-pushed the process-backend branch 3 times, most recently from 88e0dea to 48849ff Compare July 11, 2025 02:15
Signed-off-by: zirain <zirain2009@gmail.com>
@zirain zirain force-pushed the process-backend branch from 48849ff to 9bf4257 Compare July 11, 2025 02:22

case egv1a1.KindBackend:
if !r.backendCRDExists {
r.log.Info("Backend CRD does not exist, skipping processing BackendRef")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need/want this log output?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it's fine to change level to 6, since we have status.

zirain added 2 commits July 11, 2025 11:35
Signed-off-by: zirain <zirain2009@gmail.com>
Signed-off-by: zirain <zirain2009@gmail.com>
Copy link
Copy Markdown
Contributor

@jukie jukie left a comment

Choose a reason for hiding this comment

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

My approvals don't help much yet but LGTM!

@zirain
Copy link
Copy Markdown
Member Author

zirain commented Jul 11, 2025

My approvals don't help much yet but LGTM!

your approvals is helpful, we need 1 from reviewer/mantainer, and 1 from maintainer.

@zirain zirain enabled auto-merge (squash) July 11, 2025 05:51
backendRef = *oidc.Provider.BackendRef
}
if len(oidc.Provider.BackendRefs) > 0 {
backendRef = oidc.Provider.BackendRefs[0].BackendObjectReference
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why arent we inserting all ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this bug also exists in ext auth :( , lets tackle it separately

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this change however breaks functionality, because before we maybe incorrectly processing here, but with processbackendRefs we were still processing all and they would be available in the gateway-api layer.

now since we have limited processing, its going to break those multi backendRef cases

Copy link
Copy Markdown
Member Author

@zirain zirain Jul 11, 2025

Choose a reason for hiding this comment

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

All the test case is showing about use just one backend, but I change the logic to keep same as before, we can fix it later.

Signed-off-by: zirain <zirain2009@gmail.com>
@zirain zirain merged commit 1b0a7fb into envoyproxy:main Jul 15, 2025
44 of 47 checks passed
@zirain zirain deleted the process-backend branch July 15, 2025 00:59
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.

4 participants