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

Commit

Permalink
catalog: Remove GetServicesForServiceAccount from MeshCataloger inter…
Browse files Browse the repository at this point in the history
…face
  • Loading branch information
draychev committed Apr 9, 2021
1 parent f5dcb1b commit 9b1fb92
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pkg/catalog/outbound_traffic_policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (mc *MeshCatalog) ListAllowedOutboundServicesForIdentity(identity service.K
for _, t := range mc.meshSpec.ListTrafficTargets() { // loop through all traffic targets
for _, source := range t.Spec.Sources {
if source.Name == identity.Name && source.Namespace == identity.Namespace { // found outbound
destServices, err := mc.GetServicesForServiceAccount(service.K8sServiceAccount{
destServices, err := mc.getServicesForServiceAccount(service.K8sServiceAccount{
Name: t.Spec.Destination.Name,
Namespace: t.Spec.Destination.Namespace,
})
Expand Down Expand Up @@ -185,7 +185,7 @@ func (mc *MeshCatalog) getDestinationServicesFromTrafficTarget(t *access.Traffic
Name: t.Spec.Destination.Name,
Namespace: t.Spec.Destination.Namespace,
}
destServices, err := mc.GetServicesForServiceAccount(sa)
destServices, err := mc.getServicesForServiceAccount(sa)
if err != nil {
return nil, errors.Errorf("Error finding Services for Service Account %#v: %v", sa, err)
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/catalog/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ func (mc *MeshCatalog) getApexServicesForBackendService(targetService service.Me
return apexList
}

// GetServicesForServiceAccount returns a list of services corresponding to a service account
func (mc *MeshCatalog) GetServicesForServiceAccount(sa service.K8sServiceAccount) ([]service.MeshService, error) {
// getServicesForServiceAccount returns a list of services corresponding to a service account
func (mc *MeshCatalog) getServicesForServiceAccount(sa service.K8sServiceAccount) ([]service.MeshService, error) {
var services []service.MeshService
for _, provider := range mc.endpointsProviders {
providerServices, err := provider.GetServicesForServiceAccount(sa)
Expand Down
3 changes: 0 additions & 3 deletions pkg/catalog/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ type MeshCataloger interface {
// UnregisterProxy unregisters an existing proxy from the service mesh catalog
UnregisterProxy(*envoy.Proxy)

// GetServicesForServiceAccount returns a list of services corresponding to a service account
GetServicesForServiceAccount(service.K8sServiceAccount) ([]service.MeshService, error)

// GetIngressPoliciesForService returns the inbound traffic policies associated with an ingress service
GetIngressPoliciesForService(service.MeshService) ([]*trafficpolicy.InboundTrafficPolicy, error)

Expand Down

0 comments on commit 9b1fb92

Please sign in to comment.