tunnelingconfig

package
v0.0.0-...-7929486 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyFunc

type ApplyFunc = func(tcpProxy *tcp.TcpProxy, destinationRule *networking.DestinationRule, subsetName string)
var Apply ApplyFunc = func(tcpProxy *tcp.TcpProxy, destinationRule *networking.DestinationRule, subsetName string) {
	var tunnelSettings *networking.TrafficPolicy_TunnelSettings
	if subsetName != "" {
		for _, s := range destinationRule.GetSubsets() {
			if s.Name == subsetName {
				tunnelSettings = s.GetTrafficPolicy().GetTunnel()
				break
			}
		}
	} else {
		tunnelSettings = destinationRule.GetTrafficPolicy().GetTunnel()
	}

	if tunnelSettings == nil {
		return
	}

	tcpProxy.TunnelingConfig = &tcp.TcpProxy_TunnelingConfig{
		Hostname: net.JoinHostPort(tunnelSettings.GetTargetHost(), strconv.Itoa(int(tunnelSettings.GetTargetPort()))),
		UsePost:  tunnelSettings.Protocol == "POST",
	}
}

Apply configures tunneling_config in a given TcpProxy depending on the destination rule and the destination hosts

var Skip ApplyFunc = func(_ *tcp.TcpProxy, _ *networking.DestinationRule, _ string) {}

Skip has no effect; its only purpose is to avoid passing nil values for ApplyFunc arguments when it is not desired to apply `tunneling_config` to a listener, e.g. AUTO_PASSTHROUGH

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL