Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

configurator: simplify MeshConfig API #4475

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

shashankram
Copy link
Member

Description:
Simplifies the signature of GetMeshConfig() in
the interface to return an object instead of a pointer.
MeshConfig is guaranteed to exist during controller
startup and there is already a fallback to return
a default MeshConfig object if not found in the
cache. Returning a pointer results in unnecessary
nil pointer handling on the caller side, which
makes the usage of this function indeterministic
when the implementation is deterministic.
This change guarantees to the caller of this function
that they will always receive a valid MeshConfig to
operate on.

Affected area:

Functional Area
Control Plane [X]

Please answer the following questions with yes/no.

  1. Does this change contain code from or inspired by another project? no

    • Did you notify the maintainers and provide attribution?
  2. Is this a breaking change? no

Simplifies the signature of `GetMeshConfig()` in
the interface to return an object instead of pointer.
MeshConfig is guaranteed to exist upon controller
start and there is already a fallback to return
a default MeshConfig object if not found in the
cache. Returning a pointer results in unnecessary
nil pointer handling on the caller side, which
makes the usage of this function indeterministic
when the implementation is deterministic.
This change guarantees to the caller of this function
that they will always receive a valid MeshConfig to
operate on.

Signed-off-by: Shashank Ram <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Jan 25, 2022

Codecov Report

Merging #4475 (6fb50a3) into main (e45d28a) will increase coverage by 0.01%.
The diff coverage is 69.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4475      +/-   ##
==========================================
+ Coverage   69.14%   69.15%   +0.01%     
==========================================
  Files         212      212              
  Lines       14595    14591       -4     
==========================================
- Hits        10091    10090       -1     
+ Misses       4452     4449       -3     
  Partials       52       52              
Flag Coverage Δ
unittests 69.15% <69.23%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/configurator/mock_client_generated.go 0.00% <0.00%> (ø)
pkg/configurator/methods.go 73.38% <75.00%> (ø)
pkg/configurator/client.go 83.33% <83.33%> (ø)
pkg/ingress/gateway.go 78.90% <100.00%> (+0.87%) ⬆️
pkg/certificate/rotor/rotor.go 86.95% <0.00%> (+2.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e45d28a...6fb50a3. Read the comment docs.

@shashankram shashankram merged commit a8fc477 into openservicemesh:main Jan 25, 2022
@shashankram shashankram deleted the simplify-apis branch January 25, 2022 23:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants