Documentation ¶
Overview ¶
Package endpointmanager manages the list of all local endpoints
Index ¶
- Variables
- func AddEndpoint(owner regeneration.Owner, ep *endpoint.Endpoint, reason string) (err error)
- func CallbackForEndpointsAtPolicyRev(ctx context.Context, rev uint64, done func(time.Time)) error
- func EnableConntrackGC(ipv4, ipv6 bool, restoredEndpoints []*endpoint.Endpoint)
- func GetEndpoints() []*endpoint.Endpoint
- func GetPolicyEndpoints() map[policy.Endpoint]struct{}
- func HasGlobalCT() bool
- func Insert(ep *endpoint.Endpoint) error
- func IsErrInvalidPrefix(err error) bool
- func IsErrUnsupportedID(err error) bool
- func Lookup(id string) (*endpoint.Endpoint, error)
- func LookupCiliumID(id uint16) *endpoint.Endpoint
- func LookupContainerID(id string) *endpoint.Endpoint
- func LookupIP(ip net.IP) (ep *endpoint.Endpoint)
- func LookupIPv4(ipv4 string) *endpoint.Endpoint
- func LookupIPv6(ipv6 string) *endpoint.Endpoint
- func LookupPodName(name string) *endpoint.Endpoint
- func RegenerateAllEndpoints(regenMetadata *regeneration.ExternalRegenerationMetadata) *sync.WaitGroup
- func Remove(ep *endpoint.Endpoint) <-chan struct{}
- func RemoveAll()
- func UpdatePolicyMaps(ctx context.Context) *sync.WaitGroup
- func UpdateReferences(ep *endpoint.Endpoint)
- func WaitEndpointRemoved(ep *endpoint.Endpoint)
- func WaitForEndpointsAtPolicyRev(ctx context.Context, rev uint64) error
- type EndpointResourceSynchronizer
- type ErrInvalidPrefix
Constants ¶
This section is empty.
Variables ¶
var ( // ErrUnsupportedID represents an error of unsupported IP address format. ErrUnsupportedID = errors.New("unsupported IP address format") )
Functions ¶
func AddEndpoint ¶
AddEndpoint takes the prepared endpoint object and starts managing it.
func CallbackForEndpointsAtPolicyRev ¶
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 ¶
EnableConntrackGC enables the connection tracking garbage collection.
func GetEndpoints ¶
GetEndpoints returns a slice of all endpoints present in endpoint manager.
func GetPolicyEndpoints ¶
GetPolicyEndpoints returns a map of all endpoints present in endpoint manager as policy.Endpoint interface set for the map key.
func HasGlobalCT ¶
func HasGlobalCT() bool
HasGlobalCT returns true if the endpoints have a global CT, false otherwise.
func IsErrInvalidPrefix ¶
IsErrInvalidPrefix returns true if the given error is the type of ErrInvalidPrefix.
func IsErrUnsupportedID ¶
IsErrUnsupportedID returns true if the given error is the type of ErrUnsupportedID.
func LookupCiliumID ¶
LookupCiliumID looks up endpoint by endpoint ID
func LookupContainerID ¶
LookupContainerID looks up endpoint by Docker ID
func LookupIPv4 ¶
LookupIPv4 looks up endpoint by IPv4 address
func LookupIPv6 ¶
LookupIPv6 looks up endpoint by IPv6 address
func LookupPodName ¶
LookupPodName looks up endpoint by namespace + pod name
func RegenerateAllEndpoints ¶
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 ¶
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 UpdatePolicyMaps ¶
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 ¶
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 ¶
WaitEndpointRemoved waits until all operations associated with Remove of the endpoint have been completed.
Types ¶
type EndpointResourceSynchronizer ¶
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 ¶
type ErrInvalidPrefix struct { // InvalidPrefix contains the invalid prefix. InvalidPrefix string }
ErrInvalidPrefix represents the error of an invalid prefix.
func (ErrInvalidPrefix) Error ¶
func (e ErrInvalidPrefix) Error() string
Error returns the string representation of the ErrInvalidPrefix.