egresspolicy

package
v1.10.3 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package egresspolicy defines an internal representation of the Cilium Egress Policy. The structures are managed by the EgressPolicyManager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseConfigID

ParseConfigID takes a CiliumEgressNATPolicy CR and returns only the config id

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config is the internal representation of Cilium Egress NAT Policy.

func Parse

func Parse(cenp *v2alpha1.CiliumEgressNATPolicy) (*Config, error)

Parse takes a CiliumEgressNATPolicy CR and converts to Config, the internal representation of the egress nat policy

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

The egresspolicy manager stores the internal data tracking the policy and endpoint mappings. It also hooks up all the callbacks to update egress bpf map accordingly.

func NewEgressPolicyManager

func NewEgressPolicyManager() *Manager

func (*Manager) AddEgressPolicy

func (manager *Manager) AddEgressPolicy(config Config) (bool, error)

AddEgressPolicy parses the given policy config, and updates internal state with the config fields. returns bool indicates if policy is added, err inidates first encountered error

func (*Manager) DeleteEgressPolicy

func (manager *Manager) DeleteEgressPolicy(configID policyID) error

Deletes the internal state associated with the given policy, including egress eBPF map entries

func (*Manager) OnDeleteEndpoint

func (manager *Manager) OnDeleteEndpoint(endpoint *k8sTypes.CiliumEndpoint)

OnDeleteEndpoint is the event handler for endpoint deletions.

func (*Manager) OnUpdateEndpoint

func (manager *Manager) OnUpdateEndpoint(endpoint *k8sTypes.CiliumEndpoint)

OnUpdateEndpoint is the event handler for endpoint additions and updates.

Jump to

Keyboard shortcuts

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