features

package
v0.16.6 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeFailureExceptions added in v0.15.19

func ComputeFailureExceptions(defaultExceptions, inputExceptions []string) []string

ComputeFailureExceptions computes a list of failure exceptions for various tests, from a default list of exceptions and a diff given via a CLI flag. The diff is given as a list of exceptions, with optional leading +/- signs. A minus sign means the exception should be removed from the defaults; a plus sign means the exception should be added to the defaults. If there are neither minus nor plus signs, then the given exceptions are used directly without considering the defaults. See the unit tests for examples.

Types

type Feature

type Feature string

Feature is the name of a Cilium Feature (e.g. l7-proxy, cni chaining mode etc)

const (
	CNIChaining        Feature = "cni-chaining"
	MonitorAggregation Feature = "monitor-aggregation"
	L7Proxy            Feature = "l7-proxy"
	HostFirewall       Feature = "host-firewall"
	ICMPPolicy         Feature = "icmp-policy"
	Tunnel             Feature = "tunnel"
	EndpointRoutes     Feature = "endpoint-routes"

	KPRMode                Feature = "kpr-mode"
	KPRExternalIPs         Feature = "kpr-external-ips"
	KPRGracefulTermination Feature = "kpr-graceful-termination"
	KPRHostPort            Feature = "kpr-hostport"
	KPRSocketLB            Feature = "kpr-socket-lb"
	KPRNodePort            Feature = "kpr-nodeport"
	KPRSessionAffinity     Feature = "kpr-session-affinity"

	HostPort Feature = "host-port"

	NodeWithoutCilium Feature = "node-without-cilium"

	HealthChecking Feature = "health-checking"

	EncryptionPod  Feature = "encryption-pod"
	EncryptionNode Feature = "encryption-node"

	IPv4 Feature = "ipv4"
	IPv6 Feature = "ipv6"

	Flavor Feature = "flavor"

	SecretBackendK8s Feature = "secret-backend-k8s"

	CNP  Feature = "cilium-network-policy"
	CCNP Feature = "cilium-clusterwide-network-policy"
	KNP  Feature = "k8s-network-policy"

	// Whether or not CIDR selectors can match node IPs
	CIDRMatchNodes Feature = "cidr-match-nodes"

	AuthSpiffe Feature = "mutual-auth-spiffe"

	IngressController Feature = "ingress-controller"

	EgressGateway Feature = "enable-ipv4-egress-gateway"
	GatewayAPI    Feature = "enable-gateway-api"

	EnableEnvoyConfig Feature = "enable-envoy-config"

	WireguardEncapsulate Feature = "wireguard-encapsulate"

	CiliumIPAMMode Feature = "ipam"

	IPsecEnabled                  Feature = "enable-ipsec"
	ClusterMeshEnableEndpointSync Feature = "clustermesh-enable-endpoint-sync"
)

type IPFamily

type IPFamily int
const (
	// IPFamilyAny is used for non-IP based endpoints (e.g., HTTP URL),
	// and when any IP family could be used.
	IPFamilyAny IPFamily = iota
	IPFamilyV4
	IPFamilyV6
)

func GetIPFamily

func GetIPFamily(addr string) IPFamily

func (IPFamily) String

func (f IPFamily) String() string

type Requirement

type Requirement struct {
	Feature Feature
	// contains filtered or unexported fields
}

Requirement defines a test requirement. A given Set may or may not satisfy this requirement

func RequireDisabled

func RequireDisabled(feature Feature) Requirement

RequireDisabled constructs a Requirement which expects the Feature to be disabled

func RequireEnabled

func RequireEnabled(feature Feature) Requirement

RequireEnabled constructs a Requirement which expects the Feature to be enabled

func RequireMode

func RequireMode(feature Feature, mode string) Requirement

RequireMode constructs a Requirement which expects the Feature to be in the given mode

type Set

type Set map[Feature]Status

Set contains the Status of a collection of Features.

func (Set) DeriveFeatures

func (fs Set) DeriveFeatures() error

deriveFeatures derives additional features based on the status of other features

func (Set) ExtractFromConfigMap

func (fs Set) ExtractFromConfigMap(cm *v1.ConfigMap)

ExtractFromConfigMap extracts features from the Cilium ConfigMap. Note that there is no rule regarding if the default value is reflected in the ConfigMap or not.

func (Set) ExtractFromNodes

func (fs Set) ExtractFromNodes(nodesWithoutCilium map[string]struct{})

func (Set) ExtractFromVersionedConfigMap added in v0.15.11

func (fs Set) ExtractFromVersionedConfigMap(ciliumVersion semver.Version, cm *v1.ConfigMap)

ExtractFromVersionedConfigMap extracts features based on Cilium version and cilium-config ConfigMap.

func (Set) IPFamilies

func (fs Set) IPFamilies() []IPFamily

IPFamilies returns the list of enabled IP families.

func (Set) MatchRequirements

func (fs Set) MatchRequirements(reqs ...Requirement) (bool, string)

MatchRequirements returns true if the Set fs satisfies all the requirements in reqs. Returns true for empty requirements list.

type Status

type Status struct {
	Enabled bool
	Mode    string
}

Status describes the status of a Feature. Some features are either turned on or off (c.f. Enabled), while others additionally might include a Mode string which provides more information about in what mode a particular Feature is running ((e.g. when running with CNI chaining, Enabled will be true, and the Mode string will additionally contain the name of the chained CNI).

func ExtractTunnelFeatureFromVersionedConfigMap added in v0.15.21

func ExtractTunnelFeatureFromVersionedConfigMap(ciliumVersion semver.Version, cm *v1.ConfigMap) Status

func (Status) String

func (s Status) String() string

Jump to

Keyboard shortcuts

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