mirror of
https://github.com/status-im/consul.git
synced 2025-01-09 13:26:07 +00:00
ad06c96456
This commit adds a new type ComputedDestinations that will contain all destinations from any Destinations resources and will be name-aligned with a workload. This also adds an explicit-destinations controller that computes these resources. This is needed to simplify the tracking we need to do currently in the sidecar-proxy controller and makes it easier to query all explicit destinations that apply to a workload.
20 lines
354 B
Go
20 lines
354 B
Go
package catalogv2beta1
|
|
|
|
func (s *Service) IsMeshEnabled() bool {
|
|
for _, port := range s.GetPorts() {
|
|
if port.Protocol == Protocol_PROTOCOL_MESH {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
func (s *Service) FindServicePort(name string) *ServicePort {
|
|
for _, port := range s.GetPorts() {
|
|
if port.TargetPort == name {
|
|
return port
|
|
}
|
|
}
|
|
return nil
|
|
}
|