ipmanager

package
v3.0.0-beta Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IPAMNamespace = "kube-system"

	NotEnabled = iota
	InvalidInput
	NotRequested
	Requested
	Allocated
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IPAMHandler

type IPAMHandler struct {
	IPAMCR string

	IpamCli *ipammachinery.IPAMClient

	FirstPostResponse bool
	// key is IPSec.Key and value is map of ResouceInfo
	IpamResourceStore map[ficV1.HostSpec]map[ResourceRef]struct{}
	// contains filtered or unexported fields
}

func NewIpamHandler

func NewIpamHandler(ctlrId string, config *rest.Config, ipamCli *ipammachinery.IPAMClient) *IPAMHandler

func (*IPAMHandler) AddHostSpec

func (h *IPAMHandler) AddHostSpec(key ficV1.HostSpec)

AddHostSpec function to add ipSpec to the ipam context

func (*IPAMHandler) CreateIPAMResource

func (h *IPAMHandler) CreateIPAMResource() error

Create IPAM CRD

func (*IPAMHandler) GetIPAMCR

func (h *IPAMHandler) GetIPAMCR() *ficV1.IPAM

func (*IPAMHandler) GetIpAddressForHostSpec

func (h *IPAMHandler) GetIpAddressForHostSpec(key ficV1.HostSpec) (string, bool)

GetIpAddressForHostSpec function to check if fic ipSpec exists in the ipam context

func (*IPAMHandler) RegisterIPAMCRD

func (h *IPAMHandler) RegisterIPAMCRD()

Register IPAM CRD

func (*IPAMHandler) ReleaseIP

func (h *IPAMHandler) ReleaseIP(ipamLabel string, host string, key string, ref ResourceRef) string

func (*IPAMHandler) RemoveIPAMCRHostSpec

func (h *IPAMHandler) RemoveIPAMCRHostSpec(ipamCR *ficV1.IPAM, key ficV1.HostSpec, index int) (res *ficV1.IPAM, err error)

func (*IPAMHandler) RemoveResourceRef

func (h *IPAMHandler) RemoveResourceRef(key ficV1.HostSpec, ref ResourceRef)

RemoveResourceRef function to remove the resource ref entry from IPAM Resource store

func (*IPAMHandler) RemoveUnusedIPAMEntries

func (h *IPAMHandler) RemoveUnusedIPAMEntries()

func (*IPAMHandler) RequestIP

func (h *IPAMHandler) RequestIP(ipamLabel string, host string, key string, ref ResourceRef) (string, int)

Request IPAM for virtual IP address

func (*IPAMHandler) UpdateCacheWithIpAddress

func (h *IPAMHandler) UpdateCacheWithIpAddress(key ficV1.HostSpec, ipAdd string)

function to add ipSpec to the ipam context

func (*IPAMHandler) UpdateResourceRef

func (h *IPAMHandler) UpdateResourceRef(key ficV1.HostSpec, ref ResourceRef)

UpdateResourceRef function to update the IPAM Resource store

type ResourceRef

type ResourceRef struct {
	Kind      string
	Name      string
	Namespace string
}

Jump to

Keyboard shortcuts

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