netcommons

package
v0.0.0-...-2a271d3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	IPv4String             = "IPv4"
	IPv6String             = "IPv6"
	IPv4v6String           = "IPv4v6"
	UndefinedString        = "undefined"
	MULTUS          IFType = "Multus"
	DEFAULT         IFType = "Default"
)

Variables

View Source
var ReservedIstioPorts = map[int32]bool{

	15090: true,
	15053: true,
	15021: true,
	15020: true,
	15009: true,
	15008: true,
	15006: true,
	15004: true,
	15001: true,
	15000: true,
}

Functions

func FilterIPListByIPVersion

func FilterIPListByIPVersion(ipList []string, aIPVersion IPVersion) []string

FilterIPListByIPVersion filters a list of ip strings by the provided version e.g. a list of mixed ipv4 and ipv6 when filtered with ipv6 version will return a list with the ipv6 addresses

func PodIPsToStringList

func PodIPsToStringList(ips []corev1.PodIP) (ipList []string)

PodIPsToStringList converts a list of corev1.PodIP objects into a list of strings

func PrintNetTestContextMap

func PrintNetTestContextMap(netsUnderTest map[string]NetTestContext) string

PrintNetTestContextMap displays the NetTestContext full map

func TestReservedPortsUsage

func TestReservedPortsUsage(env *provider.TestEnvironment, reservedPorts map[int32]bool, portsOrigin string, logger *log.Logger) (compliantObjects, nonCompliantObjects []*testhelper.ReportObject)

Types

type ContainerIP

type ContainerIP struct {
	// ip address of the target container
	IP string
	// targetContainerIdentifier container identifier including namespace, pod name, container name, node name, and container UID
	ContainerIdentifier *provider.Container
	// interfaceName is the interface we want to target for the ping test
	InterfaceName string
}

containerIP holds a container identification and its IP for networking tests.

func (*ContainerIP) String

func (cip *ContainerIP) String() string

String Displays the ContainerIP data structure

type IFType

type IFType string

type IPVersion

type IPVersion int
const (
	Undefined IPVersion = iota
	IPv4
	IPv6
	IPv4v6
)

func GetIPVersion

func GetIPVersion(aIP string) (IPVersion, error)

GetIPVersion parses a ip address from a string and returns its version

func (IPVersion) String

func (version IPVersion) String() string

type NetTestContext

type NetTestContext struct {
	// testerContainerNodeOc session context to access the node running the container selected to initiate tests
	TesterContainerNodeName string
	// testerSource is the container select to initiate the ping tests on this given network
	TesterSource ContainerIP
	// ipDestTargets List of containers to be pinged by the testerSource on this given network
	DestTargets []ContainerIP
}

netTestContext this is a data structure describing a network test context for a given subnet (e.g. network attachment) The test context defines a tester or test initiator, that is initiating the pings. It is selected randomly (first container in the list) It also defines a list of destination ping targets corresponding to the other containers IPs on this subnet

func (*NetTestContext) String

func (testContext *NetTestContext) String() string

String displays the NetTestContext data structure

Jump to

Keyboard shortcuts

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