utils

package
v4.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AllocFor5k          = createAlloc(5000)
	ExhaustedAllocFor5k = exhaustAlloc(AllocFor5k)
)

Functions

func CreateHttpRequest

func CreateHttpRequest(oldObj, newObj []byte, isOldMalformed, isNewMalformed bool, opType v1beta1.Operation) (*http.Request, error)

func GetTconf

func GetTconf(tconfName string, tconfSet []danmtypes.TenantConfig) *danmtypes.TenantConfig

func GetTestNet

func GetTestNet(netId string, testNets []danmtypes.DanmNet) *danmtypes.DanmNet

func InitAllocPool

func InitAllocPool(dnet *danmtypes.DanmNet)

func ReserveVnis

func ReserveVnis(iface *danmtypes.IfaceProfile, vniRange []int)

func SetupAllocationPools

func SetupAllocationPools(nets []danmtypes.DanmNet) error

func ValidateHttpResponse

func ValidateHttpResponse(writer *httpstub.ResponseWriterStub, isErrorExpected bool, expectedPatches []admit.Patch) error

Types

type MalformedObject

type MalformedObject struct {
	ExtraField string `json:"extraField,omitempty"`
}

type Reservation

type Reservation struct {
	Ip  string
	Set bool
}

type ReservedIpsList

type ReservedIpsList struct {
	NetworkId    string
	Reservations []Reservation
}

func AppendIpToExpectedAllocsList

func AppendIpToExpectedAllocsList(allocs []ReservedIpsList, ip string, isExpectedToBeSet bool, networkId string) []ReservedIpsList

type ReservedVnisList

type ReservedVnisList struct {
	ProfileName  string
	VniType      string
	Reservations []VniReservation
}

func CreateExpectedVniAllocationsList

func CreateExpectedVniAllocationsList(vni int, vniType, ifaceName string, isExpectedToBeSet bool) []ReservedVnisList

type TestArtifacts

type TestArtifacts struct {
	TestNets      []danmtypes.DanmNet
	TestEps       []danmtypes.DanmEp
	ReservedIps   []ReservedIpsList
	TestTconfs    []danmtypes.TenantConfig
	ReservedVnis  []ReservedVnisList
	ExhaustAllocs []int
}

type VniReservation

type VniReservation struct {
	Vni int
	Set bool
}

Jump to

Keyboard shortcuts

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