Skip to content
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

Refactor internal/envoy/v3 package functions #6871

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

davinci26
Copy link
Contributor

Take two of #5523

That introduces a struct NewEnvoysGen that allows us to modify the behaviour of Envoy config generation. This will help with

#6806

On the debate on singleton vs struct approach. I thought this again and I realized that struct is probably worth the big diff here. For the following reason:

  • It allows us to test the behaviour much easier. With a singleton it would be impossible for higher level tests like tests in internal/featuretests to modify the behaviour of the Envoy config generation. With a struct, we can just pass the config options to the struct and test the behaviour.

Take two of projectcontour#5523

That introduces a struct `NewEnvoysGen` that allows us to modify the
behaviour of Envoy config generation. This will help with

projectcontour#6806

On the debate on `singleton` vs `struct` approach. I thought this again
and I realized that `struct` is probably worth the big diff here. For the
following reason:

* It allows us to test the behaviour much easier. With a singleton it would be
impossible for higher level tests like tests in `internal/featuretests` to modify
the behaviour of the Envoy config generation. With a struct, we can just pass the
config options to the struct and test the behaviour.

Signed-off-by: Sotiris Nanopoulos <[email protected]>
@davinci26 davinci26 requested a review from a team as a code owner January 20, 2025 14:26
@davinci26 davinci26 requested review from skriss and sunjayBhatia and removed request for a team January 20, 2025 14:26
@sunjayBhatia sunjayBhatia requested review from a team, rajatvig and wilsonwu and removed request for a team January 20, 2025 14:27
@davinci26
Copy link
Contributor Author

(waiting for the CI to pass before I give people the go ahead to review)

Copy link

codecov bot commented Jan 20, 2025

Codecov Report

Attention: Patch coverage is 91.11111% with 12 lines in your changes missing coverage. Please review.

Project coverage is 81.08%. Comparing base (2b05fca) to head (926e093).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
cmd/contour/serve.go 0.00% 6 Missing ⚠️
cmd/contour/contour.go 0.00% 4 Missing ⚠️
internal/envoy/v3/bootstrap.go 80.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6871      +/-   ##
==========================================
+ Coverage   81.05%   81.08%   +0.03%     
==========================================
  Files         133      134       +1     
  Lines       20026    20100      +74     
==========================================
+ Hits        16232    16299      +67     
- Misses       3500     3507       +7     
  Partials      294      294              
Files with missing lines Coverage Δ
internal/envoy/v3/auth.go 100.00% <100.00%> (ø)
internal/envoy/v3/cluster.go 96.47% <100.00%> (ø)
internal/envoy/v3/config_gen.go 100.00% <100.00%> (ø)
internal/envoy/v3/listener.go 98.50% <100.00%> (+<0.01%) ⬆️
internal/envoy/v3/stats.go 100.00% <100.00%> (ø)
internal/featuretests/v3/envoy.go 99.19% <100.00%> (+0.06%) ⬆️
internal/featuretests/v3/featuretests.go 86.85% <100.00%> (+0.21%) ⬆️
internal/xdscache/v3/cluster.go 100.00% <100.00%> (ø)
internal/xdscache/v3/listener.go 92.01% <100.00%> (+0.02%) ⬆️
internal/envoy/v3/bootstrap.go 92.28% <80.00%> (ø)
... and 2 more

Signed-off-by: Sotiris Nanopoulos <[email protected]>
@davinci26
Copy link
Contributor Author

@sunjayBhatia this is ready for review. Does this need a release note?

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.

1 participant