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

endpoints: don't filter service endpoints in permissive mode #4066

Merged
merged 1 commit into from
Sep 1, 2021

Conversation

shashankram
Copy link
Member

Description:
Currently, permissive mode bypasses EDS and uses Envoy's
OriginalDestination cluster for service discovery.
As a part of implementing support for TrafficSplit in
permissive mode, permissive mode will also leverage
EDS for endpoint discovery. The existing API leveraged
by EDS to discover the endpoints of a service are
not usable for permissive mode, so this change adds
support for the same.

This change also renames the function for clarity
and removes an implicit comment.

Required by #4052 and #2527.

Testing done:
Unit tests and verified permissive mode with local changes.

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

Currently, permissive mode bypasses EDS and uses Envoy's
OriginalDestination cluster for service discovery.
As a part of implementing support for TrafficSplit in
permissive mode, permissive mode will also leverage
EDS for endpoint discovery. The existing API leveraged
by EDS to discover the endpoints of a service are
not usable for permissive mode, so this change adds
support for the same.

This change also renames the function for clarity
and removes an implicit comment.

Required by openservicemesh#4052 and openservicemesh#2527.

Signed-off-by: Shashank Ram <[email protected]>
@shashankram shashankram requested a review from a team as a code owner September 1, 2021 00:13
@codecov-commenter
Copy link

Codecov Report

Merging #4066 (898e8ff) into main (2d7f62b) will increase coverage by 0.12%.
The diff coverage is 44.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4066      +/-   ##
==========================================
+ Coverage   68.32%   68.44%   +0.12%     
==========================================
  Files         206      206              
  Lines       11671    11673       +2     
==========================================
+ Hits         7974     7990      +16     
+ Misses       3647     3633      -14     
  Partials       50       50              
Flag Coverage Δ
unittests 68.44% <44.44%> (+0.12%) ⬆️

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

Impacted Files Coverage Δ
pkg/catalog/mock_catalog_generated.go 0.00% <0.00%> (ø)
pkg/envoy/eds/response.go 42.85% <50.00%> (ø)
pkg/catalog/endpoint.go 80.76% <100.00%> (+0.76%) ⬆️
pkg/crdconversion/crdconversion.go 75.00% <0.00%> (+15.21%) ⬆️

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 2d7f62b...898e8ff. Read the comment docs.

func (mc *MeshCatalog) ListEndpointsForServiceIdentity(downstreamIdentity identity.ServiceIdentity, upstreamSvc service.MeshService) ([]endpoint.Endpoint, error) {
// ListAllowedUpstreamEndpointsForService returns the list of endpoints over which the downstream client identity
// is allowed access the upstream service
func (mc *MeshCatalog) ListAllowedUpstreamEndpointsForService(downstreamIdentity identity.ServiceIdentity, upstreamSvc service.MeshService) ([]endpoint.Endpoint, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

In this issue #3190, we discussed about dropping the word allowed from method names. Basically we don't return endpoints that are not allowed.

Copy link
Member Author

Choose a reason for hiding this comment

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

For permissive mode, everything is allowed. For SMI, a subset of endpoints is allowed. Hope that makes sense.

@shashankram shashankram merged commit 742979e into openservicemesh:main Sep 1, 2021
@shashankram shashankram deleted the permissive-eds branch September 1, 2021 17:34
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