endpointslice

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndpointReady

func EndpointReady(endpoint discovery.Endpoint) bool

EndpointReady returns true if an Endpoint has the Ready condition set to true.

func IsStaleInformerCacheErr

func IsStaleInformerCacheErr(err error) bool

Types

type EndpointSet

type EndpointSet map[endpointHash]*discovery.Endpoint

EndpointSet provides simple methods for comparing sets of Endpoints.

func (EndpointSet) Delete

func (s EndpointSet) Delete(items ...*discovery.Endpoint) EndpointSet

Delete removes all items from the set.

func (EndpointSet) Get

Returns an endpoint matching the hash if contained in the set.

func (EndpointSet) Has

func (s EndpointSet) Has(item *discovery.Endpoint) bool

Has returns true if and only if item is contained in the set.

func (EndpointSet) Insert

func (s EndpointSet) Insert(items ...*discovery.Endpoint) EndpointSet

Insert adds items to the set.

func (EndpointSet) Len

func (s EndpointSet) Len() int

Len returns the size of the set.

func (EndpointSet) PopAny

func (s EndpointSet) PopAny() (*discovery.Endpoint, bool)

Returns a single element from the set.

func (EndpointSet) UnsortedList

func (s EndpointSet) UnsortedList() []*discovery.Endpoint

UnsortedList returns the slice with contents in random order.

type EndpointSliceTracker

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

EndpointSliceTracker tracks EndpointSlices and their associated generation to help determine if a change to an EndpointSlice has been processed by the EndpointSlice controller.

func NewEndpointSliceTracker

func NewEndpointSliceTracker() *EndpointSliceTracker

NewEndpointSliceTracker creates and initializes a new endpointSliceTracker.

func (*EndpointSliceTracker) DeleteService

func (est *EndpointSliceTracker) DeleteService(namespace, name string)

DeleteService removes the set of generations tracked for the Service.

func (*EndpointSliceTracker) ExpectDeletion

func (est *EndpointSliceTracker) ExpectDeletion(endpointSlice *discovery.EndpointSlice)

ExpectDeletion sets the generation to deletionExpected in this endpointSliceTracker for the provided EndpointSlice.

func (*EndpointSliceTracker) GenerationsForSliceUnsafe

func (est *EndpointSliceTracker) GenerationsForSliceUnsafe(endpointSlice *discovery.EndpointSlice) (GenerationsBySlice, bool)

GenerationsForSliceUnsafe returns the generations for the Service corresponding to the provided EndpointSlice, and a bool to indicate if it exists. A lock must be applied before calling this function.

func (*EndpointSliceTracker) HandleDeletion

func (est *EndpointSliceTracker) HandleDeletion(endpointSlice *discovery.EndpointSlice) bool

HandleDeletion removes the generation in this endpointSliceTracker for the provided EndpointSlice. This returns true if the tracker expected this EndpointSlice to be deleted and false if not.

func (*EndpointSliceTracker) Has

func (est *EndpointSliceTracker) Has(endpointSlice *discovery.EndpointSlice) bool

Has returns true if the endpointSliceTracker has a generation for the provided EndpointSlice.

func (*EndpointSliceTracker) ShouldSync

func (est *EndpointSliceTracker) ShouldSync(endpointSlice *discovery.EndpointSlice) bool

ShouldSync returns true if this endpointSliceTracker does not have a generation for the provided EndpointSlice or it is greater than the generation of the tracked EndpointSlice.

func (*EndpointSliceTracker) StaleSlices

func (est *EndpointSliceTracker) StaleSlices(service *v1.Service, endpointSlices []*discovery.EndpointSlice) bool

StaleSlices returns true if any of the following are true:

  1. One or more of the provided EndpointSlices have older generations than the corresponding tracked ones.
  2. The tracker is expecting one or more of the provided EndpointSlices to be deleted. (EndpointSlices that have already been marked for deletion are ignored here.)
  3. The tracker is tracking EndpointSlices that have not been provided.

func (*EndpointSliceTracker) Update

func (est *EndpointSliceTracker) Update(endpointSlice *discovery.EndpointSlice)

Update adds or updates the generation in this endpointSliceTracker for the provided EndpointSlice.

type GenerationsBySlice

type GenerationsBySlice map[types.UID]int64

GenerationsBySlice tracks expected EndpointSlice generations by EndpointSlice uid. A value of deletionExpected (-1) may be used here to indicate that we expect this EndpointSlice to be deleted.

type StaleInformerCache

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

StaleInformerCache errors indicate that the informer cache includes out of date resources.

func NewStaleInformerCache

func NewStaleInformerCache(msg string) *StaleInformerCache

NewStaleInformerCache return StaleInformerCache with error mes

func (*StaleInformerCache) Error

func (e *StaleInformerCache) Error() string

Jump to

Keyboard shortcuts

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