Skip to content

golang extension: implement GetAllHeaders in the cluster_specifier plugin. #39094

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

Merged
merged 2 commits into from
May 7, 2025

Conversation

oconnorkyle
Copy link
Contributor

Commit Message:
golang extension: implement GetAllHeaders in the cluster_specifier plugin.
Fixes: #38644

Additional Description:

  • This is my first time working with Envoy and Cgo so there may be better ways to implement this. I used copyHeaderMapToGo as a reference for this implementation.

Risk Level: Low
Testing: Integration testing - I would prefer to add some unit testing as well for the Go -> Cgo code, but I didn't see existing examples of this so I wasn't sure if it's common practice.
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Copy link

Hi @oconnorkyle, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #39094 was opened by oconnorkyle.

see: more, trace.

@oconnorkyle
Copy link
Contributor Author

/retest

@phlax
Copy link
Member

phlax commented Apr 17, 2025

ping @doujiang24

@ravenblackx
Copy link
Contributor

pinging @doujiang24 again.

@@ -25,6 +25,16 @@ absl::string_view referGoString(void* str) {
extern "C" {
#endif

// Returns the number of headers in the request.
uint64_t envoyGoClusterSpecifierGetNumHeaders(unsigned long long header_ptr) {
Copy link
Member

Choose a reason for hiding this comment

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

we can combine envoyGoClusterSpecifierGetNumHeaders and envoyGoClusterSpecifierGetHeadersByteSize into a single API, so that we can reduce one Go->C call.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, they are now combined into a single function call.

@doujiang24
Copy link
Member

@oconnorkyle Thanks a lot and sorry for the late, just a small comment.

Copy link

CC @envoyproxy/coverage-shephards: FYI only for changes made to (test/per_file_coverage.sh).
envoyproxy/coverage-shephards assignee is @RyanTheOptimist
CC @envoyproxy/runtime-guard-changes: FYI only for changes made to (source/common/runtime/runtime_features.cc).
CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @mattklein123
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).
CC @envoyproxy/dependency-shepherds: Your approval is needed for changes made to (bazel/.*repos.*\.bzl)|(bazel/dependency_imports\.bzl)|(api/bazel/.*\.bzl)|(.*/requirements\.txt)|(.*\.patch).
envoyproxy/dependency-shepherds assignee is @RyanTheOptimist

🐱

Caused by: #39094 was synchronize by oconnorkyle.

see: more, trace.

@oconnorkyle oconnorkyle force-pushed the cluster-specifier-all-headers branch from 8331b9d to 090b9e2 Compare April 23, 2025 15:24
@oconnorkyle
Copy link
Contributor Author

Sorry for the review spam, I messed up merging main into this branch and it assigned you all. I'm not sure if I'm able to un-assign reviews.

@oconnorkyle
Copy link
Contributor Author

/unassign RyanTheOptimist
/unassign abeyad

Copy link

oconnorkyle is not allowed to unassign users.

🐱

Caused by: a #39094 (comment) was created by @oconnorkyle.

see: more, trace.

1 similar comment
Copy link

oconnorkyle is not allowed to unassign users.

🐱

Caused by: a #39094 (comment) was created by @oconnorkyle.

see: more, trace.

@oconnorkyle oconnorkyle force-pushed the cluster-specifier-all-headers branch from 1e0bab6 to 090b9e2 Compare April 23, 2025 15:38
Signed-off-by: Kyle O'Connor <oconnorkyle@google.com>
…erSpecifierGetHeadersByteSize` functions into a single API.`

Signed-off-by: Kyle O'Connor <oconnorkyle@google.com>
@oconnorkyle oconnorkyle force-pushed the cluster-specifier-all-headers branch from 090b9e2 to 67bf879 Compare April 23, 2025 15:42
@oconnorkyle
Copy link
Contributor Author

/retest

@oconnorkyle
Copy link
Contributor Author

/retest

Copy link
Member

@doujiang24 doujiang24 left a comment

Choose a reason for hiding this comment

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

LGTM, it's good to merge~
@oconnorkyle Thanks very much.

@willemveerman
Copy link
Contributor

Thank you @oconnorkyle !

@doujiang24
Copy link
Member

Please help to merge, thanks @wbpcode @phlax

@phlax phlax merged commit a8a9b9e into envoyproxy:main May 7, 2025
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api deps Approval required for changes to Envoy's external dependencies waiting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get all headers in golang cluster_specifier plugin
7 participants