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

catalog: Remove GetServicesForServiceAccount from MeshCataloger interface #3115

Merged
merged 1 commit into from
Apr 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions pkg/catalog/mock_catalog_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 @@ -79,9 +79,6 @@ type MeshCataloger interface {
// GetServicesFromEnvoyCertificate returns a list of services the given Envoy is a member of based on the certificate provided, which is a cert issued to an Envoy for XDS communication (not Envoy-to-Envoy).
GetServicesFromEnvoyCertificate(certificate.CommonName) ([]service.MeshService, error)

// 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