v1

package
v1.9.6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownNode = errors.New("datastore: unknown Node")

	ErrUnknownENI = errors.New("datastore: unknown ENI")

	ErrUnknownIP = errors.New("datastore: unknown IP")

	ErrEmptyNode = errors.New("datastore: empty Node")

	ErrEmptyENI = errors.New("datastore: empty ENI")

	ErrNoAvailableIPAddressInDataStore = errors.New("no available ip address in datastore")

	ErrNoAvailableIPAddressInENI = errors.New("no available ip address in eni")
)

Functions

func ErrNoAvailableIPAddressWithInCoolingPeriodInENI added in v1.6.12

func ErrNoAvailableIPAddressWithInCoolingPeriodInENI(addressInfo *AddressInfo) error

Types

type AddressInfo

type AddressInfo struct {
	Address        string
	Assigned       bool
	UnassignedTime time.Time
	CrossSubnet    bool
}

type DataStore

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

func NewDataStore

func NewDataStore() *DataStore

func (*DataStore) AddENIToStore

func (ds *DataStore) AddENIToStore(node, eniID string) error

func (*DataStore) AddNodeToStore

func (ds *DataStore) AddNodeToStore(node, instanceID string) error

func (*DataStore) AddPrivateIPToStore

func (ds *DataStore) AddPrivateIPToStore(node, eniID, ipAddress string, assigned bool) error

func (*DataStore) AddPrivateIPToStoreUnsafe

func (ds *DataStore) AddPrivateIPToStoreUnsafe(node, eniID, ipAddress string, assigned, crossSubnet bool) error

Add the IP address to the Eni cache, and mark whether the IP address is an IP address across the subnet

func (*DataStore) AllocatePodPrivateIP

func (ds *DataStore) AllocatePodPrivateIP(node string) (string, error)

func (*DataStore) AllocatePodPrivateIPByENI

func (ds *DataStore) AllocatePodPrivateIPByENI(node, eniID string) (string, error)

func (*DataStore) DeleteENIFromStore

func (ds *DataStore) DeleteENIFromStore(node, eniID string) error

func (*DataStore) DeleteNodeFromStore

func (ds *DataStore) DeleteNodeFromStore(node string) error

func (*DataStore) DeletePrivateIPFromStore

func (ds *DataStore) DeletePrivateIPFromStore(node, eniID, ipAddress string)

func (*DataStore) DeletePrivateIPFromStoreUnsafe

func (ds *DataStore) DeletePrivateIPFromStoreUnsafe(node, eniID, ipAddress string)

func (*DataStore) ENIExistsInStore

func (ds *DataStore) ENIExistsInStore(node, eniID string) bool

func (*DataStore) GetENIStats

func (ds *DataStore) GetENIStats(node, eniID string) (int, int, error)

func (*DataStore) GetNodeStats

func (ds *DataStore) GetNodeStats(node string) (int, int, error)

func (*DataStore) GetUnassignedPrivateIPByNode

func (ds *DataStore) GetUnassignedPrivateIPByNode(node string) ([]string, error)

func (*DataStore) ListNodes

func (ds *DataStore) ListNodes() []string

func (*DataStore) NodeExistsInStore

func (ds *DataStore) NodeExistsInStore(node string) bool

func (*DataStore) ReleasePodPrivateIP

func (ds *DataStore) ReleasePodPrivateIP(node, eniID, ip string) error

func (*DataStore) ReleasePodPrivateIPUnsafe

func (ds *DataStore) ReleasePodPrivateIPUnsafe(node, eniID, ip string)

func (*DataStore) Synchronized

func (ds *DataStore) Synchronized(task func() error) error

Synchronized Executing transactions in locks

type ENI

type ENI struct {
	ID            string
	IPv4Addresses map[string]*AddressInfo
	// contains filtered or unexported fields
}

func (*ENI) AssignedIPv4Addresses

func (e *ENI) AssignedIPv4Addresses() int

func (*ENI) TotalIPv4Addresses

func (e *ENI) TotalIPv4Addresses() int

type Instance

type Instance struct {
	ID string
	// contains filtered or unexported fields
}

type PodIPInfo

type PodIPInfo struct {
	Address    string
	InstanceID string
	ENIID      string
}

type PodKey

type PodKey struct {
	Name        string
	Namespace   string
	ContainerID string
}

Jump to

Keyboard shortcuts

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