config

package
v0.0.0-...-33ef25c Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LocalIPAddrs = net.InterfaceAddrs
)

mock net.InterfaceAddrs to make its unit test become available

Functions

func Split

func Split(s string) []string

func ValidateIPv4LoopbackCidr

func ValidateIPv4LoopbackCidr(cidr string) error

func ValidateOwnerGroups

func ValidateOwnerGroups(include, exclude string) error

Types

type Config

type Config struct {
	ProxyPort                string        `json:"PROXY_PORT"`
	InboundCapturePort       string        `json:"INBOUND_CAPTURE_PORT"`
	InboundTunnelPort        string        `json:"INBOUND_TUNNEL_PORT"`
	ProxyUID                 string        `json:"PROXY_UID"`
	ProxyGID                 string        `json:"PROXY_GID"`
	InboundInterceptionMode  string        `json:"INBOUND_INTERCEPTION_MODE"`
	InboundTProxyMark        string        `json:"INBOUND_TPROXY_MARK"`
	InboundTProxyRouteTable  string        `json:"INBOUND_TPROXY_ROUTE_TABLE"`
	InboundPortsInclude      string        `json:"INBOUND_PORTS_INCLUDE"`
	InboundPortsExclude      string        `json:"INBOUND_PORTS_EXCLUDE"`
	OwnerGroupsInclude       string        `json:"OUTBOUND_OWNER_GROUPS_INCLUDE"`
	OwnerGroupsExclude       string        `json:"OUTBOUND_OWNER_GROUPS_EXCLUDE"`
	OutboundPortsInclude     string        `json:"OUTBOUND_PORTS_INCLUDE"`
	OutboundPortsExclude     string        `json:"OUTBOUND_PORTS_EXCLUDE"`
	OutboundIPRangesInclude  string        `json:"OUTBOUND_IPRANGES_INCLUDE"`
	OutboundIPRangesExclude  string        `json:"OUTBOUND_IPRANGES_EXCLUDE"`
	RerouteVirtualInterfaces string        `json:"KUBE_VIRT_INTERFACES"`
	ExcludeInterfaces        string        `json:"EXCLUDE_INTERFACES"`
	IptablesProbePort        uint16        `json:"IPTABLES_PROBE_PORT"`
	ProbeTimeout             time.Duration `json:"PROBE_TIMEOUT"`
	DryRun                   bool          `json:"DRY_RUN"`
	SkipRuleApply            bool          `json:"SKIP_RULE_APPLY"`
	RunValidation            bool          `json:"RUN_VALIDATION"`
	RedirectDNS              bool          `json:"REDIRECT_DNS"`
	DropInvalid              bool          `json:"DROP_INVALID"`
	CaptureAllDNS            bool          `json:"CAPTURE_ALL_DNS"`
	EnableIPv6               bool          `json:"ENABLE_INBOUND_IPV6"`
	DNSServersV4             []string      `json:"DNS_SERVERS_V4"`
	DNSServersV6             []string      `json:"DNS_SERVERS_V6"`
	NetworkNamespace         string        `json:"NETWORK_NAMESPACE"`
	// When running in host filesystem, we have different semantics around the environment.
	// For instance, we would have a node-shared IPTables lock, despite not needing it.
	// HostFilesystemPodNetwork indicates we are in this mode, typically from the CNI.
	HostFilesystemPodNetwork bool       `json:"CNI_MODE"`
	TraceLogging             bool       `json:"IPTABLES_TRACE_LOGGING"`
	DualStack                bool       `json:"DUAL_STACK"`
	HostIP                   netip.Addr `json:"HOST_IP"`
	HostIPv4LoopbackCidr     string     `json:"HOST_IPV4_LOOPBACK_CIDR"`
	Reconcile                bool       `json:"RECONCILE"`
	CleanupOnly              bool       `json:"CLEANUP_ONLY"`
	ForceApply               bool       `json:"FORCE_APPLY"`
}

Command line options nolint: maligned

func DefaultConfig

func DefaultConfig() *Config

func (*Config) FillConfigFromEnvironment

func (c *Config) FillConfigFromEnvironment() error

func (*Config) Print

func (c *Config) Print()

func (*Config) String

func (c *Config) String() string

func (*Config) Validate

func (c *Config) Validate() error

type InterceptFilter

type InterceptFilter struct {
	Values []string
	Except bool
}

func InterceptAllExcept

func InterceptAllExcept(values ...string) InterceptFilter

func InterceptOnly

func InterceptOnly(values ...string) InterceptFilter

func ParseInterceptFilter

func ParseInterceptFilter(include, exclude string) InterceptFilter

Jump to

Keyboard shortcuts

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