-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: KongUpstreamPolicy
accepted condition
#5185
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #5185 +/- ##
=======================================
+ Coverage 73.5% 75.8% +2.3%
=======================================
Files 170 172 +2
Lines 19584 19825 +241
=======================================
+ Hits 14398 15039 +641
+ Misses 4348 3933 -415
- Partials 838 853 +15 ☔ View full report in Codecov by Sentry. |
85ea9d6
to
8f51be1
Compare
KongUpstreamPolicy
accepted condition
741531c
to
4ee9eff
Compare
internal/controllers/configuration/kongupstreampolicy_controller.go
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation seems to assumpted that HTTPRoute
is always present in the cluster, but gateway API are not installed by default so there is possibility that HTTPRoute
does not exist in the cluster. I am not sure if this will cause unexpected behavior such as controller crash or endless reconcilng loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before merging, I think we should cover the reconciler with envtests to verify the status is populated as expected. We could also cover all the added helpers with unit tests (I'd highly encourage to do so).
Another important point is that KongUpstreamPolicy
might be attached not only to Service
s that are used as HTTPRoute
s' backends, but also with any other Gateway API Route that we support and netv1.Ingress
as well. I suggest we create a separate issue to handle all other Routes and Ingress references similarly to how we handle HTTPRoute
in this PR.
internal/controllers/configuration/kongupstreampolicy_controller.go
Outdated
Show resolved
Hide resolved
internal/controllers/configuration/kongupstreampolicy_controller.go
Outdated
Show resolved
Hide resolved
I created some follow-up issues to this one to avoid having is a gigantic PR
Here is an issue about adding integration tests: #5292. In addition to that, I'll add some unit tests for the helpers in this PR. Does it sound good to you?
And here is the issue about checking the ingress: #5293 |
@mlavacca Yes, that makes sense to me, thanks for creating follow-up issues! |
The controller does not start unless the gateway API is installed in the cluster, as it is wrapped by the kubernetes-ingress-controller/internal/manager/controllerdef.go Lines 254 to 274 in 4ee9eff
|
a61e0e5
to
9334fcf
Compare
2253f94
to
5297b5e
Compare
Signed-off-by: Mattia Lavacca <[email protected]>
Signed-off-by: Mattia Lavacca <[email protected]>
Signed-off-by: Mattia Lavacca <[email protected]>
5297b5e
to
cd1bdb1
Compare
Signed-off-by: Mattia Lavacca <[email protected]>
cd1bdb1
to
4c0520b
Compare
internal/controllers/configuration/kongupstreampolicy_utils_test.go
Outdated
Show resolved
Hide resolved
internal/controllers/configuration/kongupstreampolicy_utils_test.go
Outdated
Show resolved
Hide resolved
Co-authored-by: Grzegorz Burzyński <[email protected]> Signed-off-by: Mattia Lavacca <[email protected]>
What this PR does / why we need it:
Which issue this PR fixes:
Fixes #4932
Special notes for your reviewer:
PR Readiness Checklist:
Complete these before marking the PR as
ready to review
:CHANGELOG.md
release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR