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

[RFC] Clean up of MeshCataloger interface #3111

Closed
9 of 12 tasks
draychev opened this issue Apr 9, 2021 · 0 comments
Closed
9 of 12 tasks

[RFC] Clean up of MeshCataloger interface #3111

draychev opened this issue Apr 9, 2021 · 0 comments

Comments

@draychev
Copy link
Contributor

draychev commented Apr 9, 2021

This GitHub Issue is for the exploration and design of a new cleaner MeshCataloger interface.

  • Started: 2021-04-08
  • Current Status: Research & Gathering Feedback phase

--

Ongoing Changes

These are PRs and issues that are meant to be merged (fixed) and will improve the mesh catalog interface:


Explorations:

These are incomplete (unmergeable) PRs showing possible refactors and clean-ups:


Other Related Proposals:


Potential cleaned-up interface

After all changes (above) are applied we could end up with the following:

type MeshCataloger interface {
	ListInboundTrafficPolicies(service.K8sServiceAccount, []service.MeshService) []*trafficpolicy.InboundTrafficPolicy
	ListOutboundTrafficPolicies(service.K8sServiceAccount) []*trafficpolicy.OutboundTrafficPolicy
	ListAllowedOutboundServicesForIdentity(service.K8sServiceAccount) []service.MeshService
	ListAllowedInboundServiceAccounts(service.K8sServiceAccount) ([]service.K8sServiceAccount, error)
	ListAllowedOutboundServiceAccounts(service.K8sServiceAccount) ([]service.K8sServiceAccount, error)
	ListAllowedEndpointsForService(service.K8sServiceAccount, service.MeshService) ([]endpoint.Endpoint, error)
	GetResolvableServiceEndpoints(service.MeshService) ([]endpoint.Endpoint, error)
	GetIngressPoliciesForService(service.MeshService) ([]*trafficpolicy.InboundTrafficPolicy, error)
	GetTargetPortToProtocolMappingForService(service.MeshService) (map[uint32]string, error)
	GetPortToProtocolMappingForService(service.MeshService) (map[uint32]string, error)
	ListInboundTrafficTargetsWithRoutes(service.K8sServiceAccount) ([]trafficpolicy.TrafficTargetWithRoutes, error)

	ListMeshServiceForServiceAccount
	GetWeightedClustersForUpstream
	GetServiceAccountsForCert 
}

Added

  • ListMeshServiceForServiceAccount
  • GetWeightedClustersForUpstream
  • GetServiceAccountsForCert

Removed

  • GetSMISpec() smi.MeshSpec
  • ListServiceAccountsForService(service.MeshService) ([]service.K8sServiceAccount, error)
  • ListEndpointsForService(service.MeshService) ([]endpoint.Endpoint, error)
  • GetServicesFromEnvoyCertificate(certificate.CommonName) ([]service.MeshService, error)
  • GetServicesForServiceAccount(service.K8sServiceAccount) ([]service.MeshService, error)
  • ListMonitoredNamespaces() []string
  • ListSMIPolicies() ([]*split.TrafficSplit, []service.K8sServiceAccount, []*spec.HTTPRouteGroup, []*access.TrafficTarget)
  • RegisterProxy(*envoy.Proxy)
  • UnregisterProxy(*envoy.Proxy)
  • ExpectProxy(certificate.CommonName)
@draychev draychev changed the title [RFC] Redesign of MeshCataloger interface [RFC] Clean up of MeshCataloger interface Apr 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant