multinetworkpolicy

package
v0.0.0-...-734a648 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SriovResource             = "sriovnicMultiNetworkpolicyResource"
	TestNetworkName           = "test-multi-networkpolicy-sriov-network"
	TestNetworkNamespace      = namespaces.Default
	TestNetworkNamespacedName = TestNetworkNamespace + "/" + TestNetworkName
)

Functions

func AddIPTableDebugContainer

func AddIPTableDebugContainer(pod *corev1.Pod) *corev1.Pod

AddIPTableDebugContainer adds a container that polls iptables information and print them to stdout

func AddSCTPNetcatServerToPod

func AddSCTPNetcatServerToPod(pod *corev1.Pod, port intstr.IntOrString) *corev1.Pod

AddSCTPNetcatServerToPod adds a container to the pod with a SCTP netcat server that are suitable to be used with ReachMatcher.

func AddTCPNetcatServerToPod

func AddTCPNetcatServerToPod(pod *corev1.Pod, port intstr.IntOrString) *corev1.Pod

AddTCPNetcatServerToPod adds a container to the pod with a TCP netcat server that are suitable to be used with ReachMatcher.

func AddUDPNetcatServerToPod

func AddUDPNetcatServerToPod(pod *corev1.Pod, port intstr.IntOrString) *corev1.Pod

AddUDPNetcatServerToPod adds a container to the pod with a UDP netcat server that are suitable to be used with ReachMatcher.

func Reach

func Reach(destinationPod *corev1.Pod, opts ...ReachOpt) types.GomegaMatcher

Reach creates a new ReachMatcher with a destination pod and a list of options. Default options include using TCP traffic, 5555 as destination port and IPv4 as ip family.

Types

type ReachMatcher

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

ReachMatcher allows making assertion on pod connectivity using netcat servers and clients

func (*ReachMatcher) FailureMessage

func (m *ReachMatcher) FailureMessage(actual interface{}) string

func (*ReachMatcher) Match

func (m *ReachMatcher) Match(actual interface{}) (bool, error)

Match checks if the actual meets the Reach condition.

func (*ReachMatcher) NegatedFailureMessage

func (m *ReachMatcher) NegatedFailureMessage(actual interface{}) string

NegatedFailureMessage builds the message to show in case of negated assertion failure

type ReachOpt

type ReachOpt func(*ReachMatcher)

ReachOpt describe a function that applies to a ReachMatcher

var ViaIPv4 ReachOpt = func(s *ReachMatcher) {
	s.ipFamily = corev1.IPv4Protocol
}

ViaIPv4 specifies to use v4 as IP family.

var ViaIPv6 ReachOpt = func(s *ReachMatcher) {
	s.ipFamily = corev1.IPv6Protocol
}

ViaIPv6 specifies to use v6 as IP family.

var ViaSCTP ReachOpt = func(s *ReachMatcher) {
	s.protocol = corev1.ProtocolSCTP
}

ViaSCTP specifies that the SCTP protocol must be used to check the connectivity.

var ViaTCP ReachOpt = func(s *ReachMatcher) {
	s.protocol = corev1.ProtocolTCP
}

ViaTCP specifies that the TCP protocol must be used to check the connectivity.

var ViaUDP ReachOpt = func(s *ReachMatcher) {
	s.protocol = corev1.ProtocolUDP
}

ViaUDP specifies that the UDP protocol must be used to check the connectivity.

func OnPort

func OnPort(port intstr.IntOrString) ReachOpt

OnPort specifies the destination port to be used in the matcher.

Jump to

Keyboard shortcuts

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