ipam

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(
	ctx context.Context,
	datastore string,
	trenchName string,
	nspConn *grpc.ClientConn,
	cidrs map[ipamAPI.IPFamily]string,
	prefixLengths map[ipamAPI.IPFamily]*types.PrefixLengths,
	garbageCollectionEnabled bool,
	garbageCollectionInterval time.Duration,
	garbageCollectionThreshold time.Duration) (ipamAPI.IpamServer, error)

NewIpam -

Types

type IpamServer

type IpamServer struct {
	ipamAPI.UnimplementedIpamServer
	Trenches      map[ipamAPI.IPFamily]types.Trench
	PrefixLengths map[ipamAPI.IPFamily]*types.PrefixLengths
	// contains filtered or unexported fields
}

func (*IpamServer) Allocate

func (is *IpamServer) Allocate(ctx context.Context, child *ipamAPI.Child) (*ipamAPI.Prefix, error)

Note: IMHO ideally all allocations should be treated as leases. Meaning they should be required to be renewed periodically instead of being allocated forever. Would the API be extended so that users could choose between lease or permanent allocation, it would make the cluster upgrade problematic due to the possible mix of old and new clients. Hence, IMHO the best approach for now is to let the server decide which prefixes should have their expirable attribute set. Currently, this translates to calls of node.Allocate() (excluding bridges). The information regarding the time scope is passed in context to avoid the need for changing all the API in between.

func (*IpamServer) Release

func (is *IpamServer) Release(ctx context.Context, child *ipamAPI.Child) (*emptypb.Empty, error)

Directories

Path Synopsis
storage
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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