feat(server): migrate EventList to google.protobuf.Struct for K8s 1.3.5 compatibility (#25767)#26322
feat(server): migrate EventList to google.protobuf.Struct for K8s 1.3.5 compatibility (#25767)#26322chansuke wants to merge 1 commit intoargoproj:masterfrom
Conversation
❌ Preview Environment undeployed from BunnyshellAvailable commands (reply to this comment):
|
There was a problem hiding this comment.
I have a few questions/comments before I dive into more details
- Why the implementation is not following the suggestion with the wrapped struct here
- from a design point of view having GRPC and Rest returning different structs for the same call is not ideal
- Following question 1 the code now is moving away from a strongly-typed
EventListto an unstructuredgoogle.protobuf.Struct. This removes compile-time type safety and additionally the grpc clients now need to parse the returned struct, know/assume the expected structure... - I'm also skeptical about performance especially if the event list is quite big because the code now is taking several steps to transform it.
|
Thank you for your comment.
|
|
@reggie-k
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #26322 +/- ##
==========================================
+ Coverage 63.04% 63.09% +0.04%
==========================================
Files 414 415 +1
Lines 56286 56302 +16
==========================================
+ Hits 35484 35521 +37
+ Misses 17427 17410 -17
+ Partials 3375 3371 -4 ☔ View full report in Codecov by Sentry. |
This is not entirely true. There will be a breaking change when we upgrade the client to 1.35. |
|
Thanks, i understood now. the immediate break here is the gRPC API signature change and not k8s server compatibility itself. i’ll follow the #23695 strategy:
|
How is that possible? My understanding is that the problem is using the upstream k8s structs that are no longer compatible with protobuf. So if we upgrade the libs to 0.35, won't these "v1" endpoints immediately break anyway? |
|
@chansuke I apologize, looks like I have provided a misleading guidance with regard to how we should manage this breaking change earlier. We discussed this with @crenshaw-dev and on the weekly contributors meeting on Thursday, and the latest consensus is that we don't have a good alternative but breaking our API following the breaking change in K8s. It means that we will not go in the direction of maintaining 2 versions of endpoints and should instead document the breaking change and it's implications clearly (which methods break for gRPC, in what way and possible workarounds, like running the CLI with --grpc-web etc). We also need to document that for this version, a matching CLI version needs to be used, so an upgrade to this version will require using upgraded CLI (older CLI will not work with this version). If not feasible for 3.4, we will aim for 3.5 instead. |
|
@reggie-k |
ace2380 to
dfa76b6
Compare
reggie-k
left a comment
There was a problem hiding this comment.
Thanks for the updates, looks like a couple of changes are unintended and may be a result of git merge?
|
|
||
| **Related Issue** | ||
|
|
||
| https://github.com/argoproj/argo-cd/issues/24991 |
There was a problem hiding this comment.
This section looks removed due to possibly a local git merge?
| @@ -818,7 +818,7 @@ | |||
| "200": { | |||
| "description": "A successful response.", | |||
There was a problem hiding this comment.
Since now we return a general structure instead of v1EventList it would be great to add here comment on the expected response structure
There was a problem hiding this comment.
Thanks for the feedback. I agree this would be useful. My idea is to add swagger annotations to the .proto files. I’ll create a separate follow-up PR for that
Signed-off-by: chansuke <moonset20@gmail.com>
Closes #25767
Change the return type of
ListResourceEventsandListEventsgRPC APIs fromk8s.io.api.core.v1.EventListtogoogle.protobuf.Structto avoid protobuf compatibility issues with Kubernetes 1.35+.Affected endpoints
Breaking Changes
google.protobuf.Structinstead ofEventList.Checklist: