import "istio.io/istio/pilot/pkg/networking/util"
const ( // BlackHoleCluster to catch traffic from routes with unresolved clusters. Traffic arriving here goes nowhere. BlackHoleCluster = "BlackHoleCluster" // BlackHole is the name of the virtual host and route name used to block all traffic BlackHole = "block_all" // PassthroughCluster to forward traffic to the original destination requested. This cluster is used when // traffic does not match any listener in envoy. PassthroughCluster = "PassthroughCluster" // Passthrough is the name of the virtual host used to forward traffic to the // PassthroughCluster Passthrough = "allow_any" // PassthroughFilterChain to catch traffic that doesn't match other filter chains. PassthroughFilterChain = "PassthroughFilterChain" // Inbound pass through cluster need to the bind the loopback ip address for the security and loop avoidance. InboundPassthroughClusterIpv4 = "InboundPassthroughClusterIpv4" InboundPassthroughClusterIpv6 = "InboundPassthroughClusterIpv6" // 6 is the magical number for inbound: 15006, 127.0.0.6, ::6 InboundPassthroughBindIpv4 = "127.0.0.6" InboundPassthroughBindIpv6 = "::6" // SniClusterFilter is the name of the sni_cluster envoy filter SniClusterFilter = "envoy.filters.network.sni_cluster" // IstioMetadataKey is the key under which metadata is added to a route or cluster // regarding the virtual service or destination rule used for each IstioMetadataKey = "istio" // EnvoyTransportSocketMetadataKey is the key under which metadata is added to an endpoint // which determines the endpoint level transport socket configuration. EnvoyTransportSocketMetadataKey = "envoy.transport_socket_match" // EnvoyRawBufferSocketName matched with hardcoded built-in Envoy transport name which determines // endpoint level plantext transport socket configuration EnvoyRawBufferSocketName = wellknown.TransportSocketRawBuffer // EnvoyTLSSocketName matched with hardcoded built-in Envoy transport name which determines endpoint // level tls transport socket configuration EnvoyTLSSocketName = wellknown.TransportSocketTls )
ALPNDownstream advertises that Proxy is going to talking either tcp(for metadata exchange), http2 or http 1.1.
ALPNH2Only advertises that Proxy is going to use HTTP/2 when talking to the cluster.
ALPNHttp advertises that Proxy is going to talking either http2 or http 1.1.
ALPNInMesh advertises that Proxy is going to talk to the in-mesh cluster. The custom "istio" value indicates in-mesh traffic and it's going to be used for routing decisions.
ALPNInMeshH2 advertises that Proxy is going to use HTTP/2 when talking to the in-mesh cluster. The custom "istio" value indicates in-mesh traffic and it's going to be used for routing decisions. Once Envoy supports client-side ALPN negotiation, this should be {"istio", "h2", "http/1.1"}.
ALPNInMeshH2WithMxc advertises that Proxy is going to use HTTP/2 when talking to the in-mesh cluster. The custom "istio" value indicates in-mesh traffic and it's going to be used for routing decisions. The custom "istio-peer-exchange" value indicates, metadata exchange is enabled for TCP.
ALPNInMeshWithMxc advertises that Proxy is going to talk to the in-mesh cluster and has metadata exchange enabled for TCP. The custom "istio-peer-exchange" value indicates, metadata exchange is enabled for TCP. The custom "istio" value indicates in-mesh traffic and it's going to be used for routing decisions.
var FallThroughFilterChainBlackHoleService = &model.Service{ Hostname: host.Name(BlackHoleCluster), Attributes: model.ServiceAttributes{ Name: BlackHoleCluster, }, }
FallThroughFilterChainBlackHoleService is the blackhole service used for fall though filter chain
var FallThroughFilterChainPassthroughService = &model.Service{ Hostname: host.Name(PassthroughCluster), Attributes: model.ServiceAttributes{ Name: PassthroughCluster, }, }
FallThroughFilterChainPassthroughService is the passthrough service used for fall though
AddConfigInfoMetadata adds name.namespace of the config, the type, etc to the given core.Metadata struct, if metadata is not initialized, build a new metadata.
AddSubsetToMetadata will build a new core.Metadata struct containing the subset name supplied. This is used for telemetry reporting. A new core.Metadata is created to prevent modification to shared base Metadata across subsets, etc. This should be called after the initial "istio" metadata has been created for the cluster. If the "istio" metadata field is not already defined, the subset information will not be added (to prevent adding this information where not needed).
BuildAddress returns a SocketAddress with the given ip and port or uds.
BuildConfigInfoMetadata builds core.Metadata struct containing the name.namespace of the config, the type, etc.
func BuildInboundSubsetKey(node *model.Proxy, subsetName string, hostname host.Name, servicePort int, endpointPort int) string
func BuildLbEndpointMetadata(network, tlsMode, workloadname, namespace string, labels labels.Instance) *core.Metadata
BuildLbEndpointMetadata adds metadata values to a lb endpoint
func BuildStatPrefix(statPattern string, host string, subset string, port *model.Port, attributes model.ServiceAttributes) string
BuildStatPrefix builds a stat prefix based on the stat pattern.
ByteCount returns a human readable byte format Inspired by https://yourbasic.org/golang/formatting-byte-size-to-human-readable-format/
func CloneClusterLoadAssignment(original *endpoint.ClusterLoadAssignment) *endpoint.ClusterLoadAssignment
return a shallow copy ClusterLoadAssignment
ConvertAddressToCidr converts from string to CIDR proto
ConvertLocality converts '/' separated locality string to Locality struct.
GogoDurationToDuration converts from gogo proto duration to time.duration
IsAllowAnyOutbound checks if allow_any is enabled for outbound traffic
func IsHTTPFilterChain(filterChain *listener.FilterChain) bool
IsHTTPFilterChain returns true if the filter chain contains a HTTP connection manager filter
IsIstioVersionGE18 checks whether the given Istio version is greater than or equals 1.8.
IsIstioVersionGE181 checks whether the given Istio version is greater than or equals 1.8.1
IsIstioVersionGE19 checks whether the given Istio version is greater than or equals 1.9.
IsLocalityEmpty checks if a locality is empty (checking region is good enough, based on how its initialized)
ConvertLocality converts '/' separated locality string to Locality struct.
MergeAnyWithAny merges a given any typed message into the given Any typed message by dynamically inferring the type of Any
MergeAnyWithStruct merges a given struct into the given Any typed message by dynamically inferring the type of Any, converting the struct into the inferred type, merging the two messages, and then marshaling the merged message back into Any.
func MeshConfigToEnvoyForwardClientCertDetails(c meshconfig.Topology_ForwardClientCertDetails) http_conn.HttpConnectionManager_ForwardClientCertDetails
meshconfig ForwardClientCertDetails and the Envoy config enum are off by 1 due to the UNDEFINED in the meshconfig ForwardClientCertDetails
MessageToAny converts from proto message to proto Any
MessageToAnyWithError converts from proto message to proto Any
MessageToStruct converts from proto message to proto Struct
func MultiErrorFormat() multierror.ErrorFormatFunc
MultiErrorFormat provides a format for multierrors. This matches the default format, but if there is only one error we will not expand to multiple lines.
func SortVirtualHosts(hosts []*route.VirtualHost)
SortVirtualHosts sorts a slice of virtual hosts by name.
Envoy computes a hash of RDS to see if things have changed - hash is affected by order of elements in the filter. Therefore we sort virtual hosts by name before handing them back so the ordering is stable across HTTP Route Configs.
func StringToExactMatch(in []string) []*matcher.StringMatcher
func StringToPrefixMatch(in []string) []*matcher.StringMatcher
Package util imports 31 packages (graph) and is imported by 36 packages. Updated 2020-12-03. Refresh now. Tools for package owners.