endpointmanager

package
v1.6.12 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package endpointmanager manages the list of all local endpoints

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedID represents an error of unsupported IP address format.
	ErrUnsupportedID = errors.New("unsupported IP address format")
)

Functions

func AddEndpoint added in v1.5.0

func AddEndpoint(owner regeneration.Owner, ep *endpoint.Endpoint, reason string) (err error)

AddEndpoint takes the prepared endpoint object and starts managing it.

func CallbackForEndpointsAtPolicyRev added in v1.5.0

func CallbackForEndpointsAtPolicyRev(ctx context.Context, rev uint64, done func(time.Time)) error

CallbackForEndpointsAtPolicyRev registers a callback on all endpoints that exist when invoked. It is similar to WaitForEndpointsAtPolicyRevision but each endpoint that reaches the desired revision calls 'done' independently. The provided callback should not block and generally be lightweight.

func EnableConntrackGC

func EnableConntrackGC(ipv4, ipv6 bool, restoredEndpoints []*endpoint.Endpoint)

EnableConntrackGC enables the connection tracking garbage collection.

func GetEndpoints added in v1.5.0

func GetEndpoints() []*endpoint.Endpoint

GetEndpoints returns a slice of all endpoints present in endpoint manager.

func GetPolicyEndpoints added in v1.6.0

func GetPolicyEndpoints() map[policy.Endpoint]struct{}

GetPolicyEndpoints returns a map of all endpoints present in endpoint manager as policy.Endpoint interface set for the map key.

func HasGlobalCT added in v1.5.0

func HasGlobalCT() bool

HasGlobalCT returns true if the endpoints have a global CT, false otherwise.

func Insert

func Insert(ep *endpoint.Endpoint) error

Insert inserts the endpoint into the global maps.

func IsErrInvalidPrefix added in v1.5.0

func IsErrInvalidPrefix(err error) bool

IsErrInvalidPrefix returns true if the given error is the type of ErrInvalidPrefix.

func IsErrUnsupportedID added in v1.5.0

func IsErrUnsupportedID(err error) bool

IsErrUnsupportedID returns true if the given error is the type of ErrUnsupportedID.

func Lookup

func Lookup(id string) (*endpoint.Endpoint, error)

Lookup looks up the endpoint by prefix id

func LookupCiliumID

func LookupCiliumID(id uint16) *endpoint.Endpoint

LookupCiliumID looks up endpoint by endpoint ID

func LookupContainerID added in v1.5.0

func LookupContainerID(id string) *endpoint.Endpoint

LookupContainerID looks up endpoint by Docker ID

func LookupIP added in v1.6.0

func LookupIP(ip net.IP) (ep *endpoint.Endpoint)

LookupIP looks up endpoint by IP address

func LookupIPv4

func LookupIPv4(ipv4 string) *endpoint.Endpoint

LookupIPv4 looks up endpoint by IPv4 address

func LookupIPv6 added in v1.5.0

func LookupIPv6(ipv6 string) *endpoint.Endpoint

LookupIPv6 looks up endpoint by IPv6 address

func LookupPodName added in v1.5.0

func LookupPodName(name string) *endpoint.Endpoint

LookupPodName looks up endpoint by namespace + pod name

func RegenerateAllEndpoints added in v1.5.0

func RegenerateAllEndpoints(regenMetadata *regeneration.ExternalRegenerationMetadata) *sync.WaitGroup

RegenerateAllEndpoints calls a SetStateLocked for each endpoint and regenerates if state transaction is valid. During this process, the endpoint list is locked and cannot be modified. Returns a waiting group that can be used to know when all the endpoints are regenerated.

func Remove added in v1.5.0

func Remove(ep *endpoint.Endpoint) <-chan struct{}

Remove removes the endpoint from the global maps and releases the node-local ID allocated for the endpoint. Must be called with ep.Mutex.RLock held. Releasing of the ID of the endpoint is done asynchronously. Once the ID of the endpoint is released, the returned channel is closed.

func RemoveAll added in v1.5.0

func RemoveAll()

RemoveAll removes all endpoints from the global maps.

func UpdatePolicyMaps added in v1.6.2

func UpdatePolicyMaps(ctx context.Context) *sync.WaitGroup

UpdatePolicyMaps returns a WaitGroup which is signaled upon once all endpoints have had their PolicyMaps updated against the Endpoint's desired policy state.

func UpdateReferences

func UpdateReferences(ep *endpoint.Endpoint)

UpdateReferences makes an endpoint available by all possible reference fields as available for this endpoint (containerID, IPv4 address, ...) Must be called with ep.Mutex.RLock held.

func WaitEndpointRemoved added in v1.5.0

func WaitEndpointRemoved(ep *endpoint.Endpoint)

WaitEndpointRemoved waits until all operations associated with Remove of the endpoint have been completed.

func WaitForEndpointsAtPolicyRev added in v1.5.0

func WaitForEndpointsAtPolicyRev(ctx context.Context, rev uint64) error

WaitForEndpointsAtPolicyRev waits for all endpoints which existed at the time this function is called to be at a given policy revision. New endpoints appearing while waiting are ignored.

Types

type EndpointResourceSynchronizer added in v1.5.0

type EndpointResourceSynchronizer interface {
	RunK8sCiliumEndpointSync(ep *endpoint.Endpoint)
}

EndpointResourceSynchronizer is an interface which synchronizes CiliumEndpoint resources with Kubernetes.

var (

	// EndpointSynchronizer updates external resources (e.g., Kubernetes) with
	// up-to-date information about endpoints managed by the endpoint manager.
	EndpointSynchronizer EndpointResourceSynchronizer
)

type ErrInvalidPrefix added in v1.5.0

type ErrInvalidPrefix struct {
	// InvalidPrefix contains the invalid prefix.
	InvalidPrefix string
}

ErrInvalidPrefix represents the error of an invalid prefix.

func (ErrInvalidPrefix) Error added in v1.5.0

func (e ErrInvalidPrefix) Error() string

Error returns the string representation of the ErrInvalidPrefix.

Jump to

Keyboard shortcuts

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