pool

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IPBlocksAnnotation = "ipam.nvidia.com/ip-blocks"
)

Variables

This section is empty.

Functions

func IPBlockAnnotationExists

func IPBlockAnnotationExists(node *v1.Node) bool

IPBlockAnnotationExists returns true if ip-block annotation exist

func RemoveIPBlockAnnotation

func RemoveIPBlockAnnotation(node *v1.Node)

RemoveIPBlockAnnotation removes annotation with ip-block from the node object

func SetIPBlockAnnotation

func SetIPBlockAnnotation(node *v1.Node, pools map[string]*IPPool) error

SetIPBlockAnnotation serialize IP pools settings for the node and add this info as annotation

Types

type IPPool

type IPPool struct {
	Name    string `json:"-"`
	Subnet  string `json:"subnet"`
	StartIP string `json:"startIP"`
	EndIP   string `json:"endIP"`
	Gateway string `json:"gateway"`
}

IPPool represents a block of IPs from a given Subnet

type Manager

type Manager interface {
	// GetPoolByName returns IPPool for the provided pool name or nil if pool doesnt exist
	GetPoolByName(name string) *IPPool
	// GetPools returns map with information about all pools
	GetPools() map[string]*IPPool
}

Manager is an interface to manage IPPools

type ManagerImpl

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

func NewManagerImpl

func NewManagerImpl(node *v1.Node) (*ManagerImpl, error)

func (*ManagerImpl) GetPoolByName

func (pm *ManagerImpl) GetPoolByName(name string) *IPPool

GetPoolByName implements Manager interface

func (*ManagerImpl) GetPools

func (pm *ManagerImpl) GetPools() map[string]*IPPool

GetPools implements Manager interface

Jump to

Keyboard shortcuts

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