Skip to content

Conversation

@hown3d
Copy link
Member

@hown3d hown3d commented Mar 18, 2025

What this PR does / why we need it:
Refactors the code to use the proto definitions of envoy instead of relying on map[string]interface{}.
This ensures type safety and increases developer experience a lot, since you no longer have to dig deep in the envoy documentation in regards to syntax.

Special notes for your reviewer:
/cc @timebertt
Tested on ond-b0bd64 with shoot test-acl

@hown3d hown3d force-pushed the refactor/types branch 2 times, most recently from 859f14e to 9e7beaf Compare March 18, 2025 16:04
Copy link
Member

@dergeberl dergeberl left a comment

Choose a reason for hiding this comment

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

Very nice to have this objects typed! 🎉

We added a few comments.
I will have a second look incl. the cluster on the ondemand after resolving our comments.

if err := json.Unmarshal([]byte(originalFilter.Raw), &originalFilterMap); err != nil {
return admission.Errored(http.StatusInternalServerError, err)
var originalFilter *structpb.Struct
for _, configpatch := range filter.Spec.ConfigPatches {
Copy link
Member

Choose a reason for hiding this comment

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

In the gjson we only checked the ConfigPatches[0].

Copy link
Member Author

Choose a reason for hiding this comment

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

We could break the outer loop when we find the first occurence of"envoy.filters.network.tcp_proxy" in a filterList. This way we are safe if the configPatches changes and something is added before the tcp_proxy filter

@hown3d hown3d requested a review from dergeberl April 15, 2025 15:36
hown3d added 10 commits August 7, 2025 11:05
Signed-off-by: Lukas Hoehl <[email protected]>
Signed-off-by: Lukas Hoehl <[email protected]>
Signed-off-by: Lukas Hoehl <[email protected]>
Signed-off-by: Lukas Hoehl <[email protected]>
Signed-off-by: Lukas Hoehl <[email protected]>
Signed-off-by: Lukas Hoehl <[email protected]>
Signed-off-by: Lukas Hoehl <[email protected]>
@hown3d hown3d requested a review from Wieneo as a code owner August 7, 2025 09:08
hown3d added 3 commits August 7, 2025 11:11
Signed-off-by: Lukas Hoehl <[email protected]>
Signed-off-by: Lukas Hoehl <[email protected]>
Signed-off-by: Lukas Hoehl <[email protected]>
Signed-off-by: Lukas Hoehl <[email protected]>
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.

3 participants