-
Notifications
You must be signed in to change notification settings - Fork 276
feat(mesh catalog): Return list of services for a given service account #1553
Conversation
func (mc *MeshCatalog) GetServiceForServiceAccount(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) { | ||
services := []service.MeshService{} | ||
for _, provider := range mc.endpointsProviders { | ||
// TODO (#88) : remove this provider check once we have figured out the service account story for azure vms | ||
if provider.GetID() != constants.AzureProviderName { | ||
log.Trace().Msgf("[%s] Looking for Services for Name=%s", provider.GetID(), sa) | ||
service, err := provider.GetServiceForServiceAccount(sa) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will refactor provider functions (if needed) when Shashank merges his change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
if destErr != nil { | ||
log.Error().Msgf("TrafficTarget %s/%s could not get destination services for service account %s", trafficTargets.Namespace, trafficTargets.Name, dstNamespacedServiceAcc.String()) | ||
return nil, destErr | ||
} | ||
destService := destServiceList[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be good to create an issue and reference it wherever these assumptions are being made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated issue #1550
func (mc *MeshCatalog) GetServiceForServiceAccount(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) { | ||
services := []service.MeshService{} | ||
for _, provider := range mc.endpointsProviders { | ||
// TODO (#88) : remove this provider check once we have figured out the service account story for azure vms | ||
if provider.GetID() != constants.AzureProviderName { | ||
log.Trace().Msgf("[%s] Looking for Services for Name=%s", provider.GetID(), sa) | ||
service, err := provider.GetServiceForServiceAccount(sa) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great!
Thank you @ksubrmnn
Please describe the motivation for this PR and provide enough
information so that others can review it.
Returns a list of services instead of a single service for a given service account
Please mark with X for applicable areas.
Please answer the following questions with yes/no.
No