You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a naming convention only and there is nothing in Consul stopping users from naming proxies differently if they don't use the sidecar_service helper.
The canonical way to tell if something is a Proxy in Connect's data model is if service.Kind == "connect-proxy". If it's important that it's specifically a sidecar proxy (not say an ingress loadbalancer) which is true in this case you need to also check for service.Proxy.DestinationServiceID != "" - The thing that canonically makes a Proxy service a sidecar is that field indicating that it is has exactly one app (destination) instance behind it.
So to correctly skip sidecar proxies in this loop the following should work:
// Skip all sidecar proxy registrationsifs.Service.Kind==api.ServiceKindConnectProxy&&s.Service.Proxy.DestinationServiceID!="" {
continue
}
NOTE: In fact this whole loop might need to change making this issue moot. I'll explain more in the issue that I'll link below, but this was important to note to make sure the guarantees are understood here.
The text was updated successfully, but these errors were encountered:
haproxy-consul-connect/main.go
Lines 57 to 59 in 55bff42
This is a naming convention only and there is nothing in Consul stopping users from naming proxies differently if they don't use the sidecar_service helper.
The canonical way to tell if something is a Proxy in Connect's data model is if
service.Kind == "connect-proxy"
. If it's important that it's specifically a sidecar proxy (not say an ingress loadbalancer) which is true in this case you need to also check forservice.Proxy.DestinationServiceID != ""
- The thing that canonically makes a Proxy service a sidecar is that field indicating that it is has exactly one app (destination) instance behind it.So to correctly skip sidecar proxies in this loop the following should work:
NOTE: In fact this whole loop might need to change making this issue moot. I'll explain more in the issue that I'll link below, but this was important to note to make sure the guarantees are understood here.
The text was updated successfully, but these errors were encountered: