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 ¶ added in v1.5.0
AddEndpoint takes the prepared endpoint object and starts managing it.
func CallbackForEndpointsAtPolicyRev ¶ added in v1.5.0
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 ¶ added in v1.5.0
GetEndpoints returns a slice of all endpoints present in endpoint manager.
func GetPolicyEndpoints ¶ added in v1.6.0
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 IsErrInvalidPrefix ¶ added in v1.5.0
IsErrInvalidPrefix returns true if the given error is the type of ErrInvalidPrefix.
func IsErrUnsupportedID ¶ added in v1.5.0
IsErrUnsupportedID returns true if the given error is the type of ErrUnsupportedID.
func LookupCiliumID ¶
LookupCiliumID looks up endpoint by endpoint ID
func LookupContainerID ¶ added in v1.5.0
LookupContainerID looks up endpoint by Docker ID
func LookupIPv4 ¶
LookupIPv4 looks up endpoint by IPv4 address
func LookupIPv6 ¶ added in v1.5.0
LookupIPv6 looks up endpoint by IPv6 address
func LookupPodName ¶ added in v1.5.0
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
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
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 ¶ added in v1.5.0
WaitEndpointRemoved waits until all operations associated with Remove of the endpoint have been completed.
func WaitForEndpointsAtPolicyRev ¶ added in v1.5.0
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
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.