Documentation ¶
Index ¶
- type MockContiv
- func (mc *MockContiv) CleanupIdleNATSessions() bool
- func (mc *MockContiv) DeletingPod(podID podmodel.ID)
- func (mc *MockContiv) GetContainerIndex() containeridx.Reader
- func (mc *MockContiv) GetDefaultInterface() (ifName string, ifAddress net.IP)
- func (mc *MockContiv) GetHostIPs() []net.IP
- func (mc *MockContiv) GetHostInterconnectIfName() string
- func (mc *MockContiv) GetIfName(podNamespace string, podName string) (name string, exists bool)
- func (mc *MockContiv) GetMainPhysicalIfName() string
- func (mc *MockContiv) GetMainVrfID() uint32
- func (mc *MockContiv) GetNatLoopbackIP() net.IP
- func (mc *MockContiv) GetNodeIP() (net.IP, *net.IPNet)
- func (mc *MockContiv) GetNsIndex(podNamespace string, podName string) (nsIndex uint32, exists bool)
- func (mc *MockContiv) GetOtherNATSessionTimeout() uint32
- func (mc *MockContiv) GetOtherPhysicalIfNames() []string
- func (mc *MockContiv) GetPodByAppNsIndex(nsIndex uint32) (podNamespace string, podName string, exists bool)
- func (mc *MockContiv) GetPodByIf(ifname string) (podNamespace string, podName string, exists bool)
- func (mc *MockContiv) GetPodNetwork() (podNetwork *net.IPNet)
- func (mc *MockContiv) GetPodSubnet() *net.IPNet
- func (mc *MockContiv) GetPodVrfID() uint32
- func (mc *MockContiv) GetServiceLocalEndpointWeight() uint8
- func (mc *MockContiv) GetTCPNATSessionTimeout() uint32
- func (mc *MockContiv) GetVxlanBVIIfName() string
- func (mc *MockContiv) InSTNMode() bool
- func (mc *MockContiv) IsTCPstackDisabled() bool
- func (mc *MockContiv) NatExternalTraffic() bool
- func (mc *MockContiv) RegisterPodPostAddHook(hook contiv.PodActionHook)
- func (mc *MockContiv) RegisterPodPreRemovalHook(hook contiv.PodActionHook)
- func (mc *MockContiv) SetContainerIndex(ci *containeridx.ConfigIndex)
- func (mc *MockContiv) SetDefaultInterface(ifName string, ifIP net.IP)
- func (mc *MockContiv) SetHostIPs(ips []net.IP)
- func (mc *MockContiv) SetHostInterconnectIfName(ifName string)
- func (mc *MockContiv) SetMainPhysicalIfName(ifName string)
- func (mc *MockContiv) SetMainVrfID(id uint32)
- func (mc *MockContiv) SetNatExternalTraffic(natExternalTraffic bool)
- func (mc *MockContiv) SetNatLoopbackIP(natLoopIP string)
- func (mc *MockContiv) SetNodeIP(nodeIP string)
- func (mc *MockContiv) SetOtherPhysicalIfNames(ifs []string)
- func (mc *MockContiv) SetPodAppNsIndex(pod podmodel.ID, nsIndex uint32)
- func (mc *MockContiv) SetPodIfName(pod podmodel.ID, ifName string)
- func (mc *MockContiv) SetPodNetwork(podNetwork string)
- func (mc *MockContiv) SetPodVrfID(id uint32)
- func (mc *MockContiv) SetSTNMode(stnMode bool)
- func (mc *MockContiv) SetServiceLocalEndpointWeight(weight uint8)
- func (mc *MockContiv) SetTCPStackDisabled(tcpStackDisabled bool)
- func (mc *MockContiv) SetVxlanBVIIfName(ifName string)
- func (mc *MockContiv) WatchNodeIP(subscriber chan string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockContiv ¶
MockContiv is a mock for the Contiv Plugin.
func NewMockContiv ¶
func NewMockContiv() *MockContiv
NewMockContiv is a constructor for MockContiv.
func (*MockContiv) CleanupIdleNATSessions ¶
func (mc *MockContiv) CleanupIdleNATSessions() bool
CleanupIdleNATSessions returns true if cleanup of idle NAT sessions is enabled.
func (*MockContiv) DeletingPod ¶
func (mc *MockContiv) DeletingPod(podID podmodel.ID)
DeletingPod allows to simulate event of deleting pod - all registered pre-removal hooks are called.
func (*MockContiv) GetContainerIndex ¶
func (mc *MockContiv) GetContainerIndex() containeridx.Reader
GetContainerIndex returns the index of configured containers/pods
func (*MockContiv) GetDefaultInterface ¶
func (mc *MockContiv) GetDefaultInterface() (ifName string, ifAddress net.IP)
GetDefaultInterface returns the name and the IP address of the interface used by the default route to send packets out from VPP towards the default gateway. If the default GW is not configured, the function returns zero values.
func (*MockContiv) GetHostIPs ¶
func (mc *MockContiv) GetHostIPs() []net.IP
GetHostIPs returns all IP addresses of this node present in the host network namespace (Linux).
func (*MockContiv) GetHostInterconnectIfName ¶
func (mc *MockContiv) GetHostInterconnectIfName() string
GetHostInterconnectIfName returns the name of the TAP/AF_PACKET interface interconnecting VPP with the host stack.
func (*MockContiv) GetIfName ¶
func (mc *MockContiv) GetIfName(podNamespace string, podName string) (name string, exists bool)
GetIfName returns pod's interface name as set previously using SetPodIfName.
func (*MockContiv) GetMainPhysicalIfName ¶
func (mc *MockContiv) GetMainPhysicalIfName() string
GetMainPhysicalIfName returns name of the "main" interface - i.e. physical interface connecting the node with the rest of the cluster.
func (*MockContiv) GetMainVrfID ¶
func (mc *MockContiv) GetMainVrfID() uint32
GetMainVrfID returns the ID of the main network connectivity VRF.
func (*MockContiv) GetNatLoopbackIP ¶
func (mc *MockContiv) GetNatLoopbackIP() net.IP
GetNatLoopbackIP returns the IP address of a virtual loopback, used to route traffic between clients and services via VPP even if the source and destination are the same IP addresses and would otherwise be routed locally.
func (*MockContiv) GetNodeIP ¶
func (mc *MockContiv) GetNodeIP() (net.IP, *net.IPNet)
GetNodeIP returns the IP+network address of this node.
func (*MockContiv) GetNsIndex ¶
func (mc *MockContiv) GetNsIndex(podNamespace string, podName string) (nsIndex uint32, exists bool)
GetNsIndex returns pod's namespace index as set previously using SetPodNsIndex.
func (*MockContiv) GetOtherNATSessionTimeout ¶
func (mc *MockContiv) GetOtherNATSessionTimeout() uint32
GetOtherNATSessionTimeout returns NAT session timeout (in minutes) for non-TCP connections, used in case that CleanupIdleNATSessions is turned on.
func (*MockContiv) GetOtherPhysicalIfNames ¶
func (mc *MockContiv) GetOtherPhysicalIfNames() []string
GetOtherPhysicalIfNames returns a slice of names of all physical interfaces configured additionally to the main interface.
func (*MockContiv) GetPodByAppNsIndex ¶
func (mc *MockContiv) GetPodByAppNsIndex(nsIndex uint32) (podNamespace string, podName string, exists bool)
GetPodByAppNsIndex looks up podName and podNamespace that is associated with the VPP application namespace.
func (*MockContiv) GetPodByIf ¶
func (mc *MockContiv) GetPodByIf(ifname string) (podNamespace string, podName string, exists bool)
GetPodByIf looks up podName and podNamespace that is associated with logical interface name.
func (*MockContiv) GetPodNetwork ¶
func (mc *MockContiv) GetPodNetwork() (podNetwork *net.IPNet)
GetPodNetwork returns static subnet constant that should represent pod subnet for current host node
func (*MockContiv) GetPodSubnet ¶
func (mc *MockContiv) GetPodSubnet() *net.IPNet
GetPodSubnet provides subnet used for allocating pod IP addresses across all nodes.
func (*MockContiv) GetPodVrfID ¶
func (mc *MockContiv) GetPodVrfID() uint32
GetPodVrfID returns the ID of the POD VRF.
func (*MockContiv) GetServiceLocalEndpointWeight ¶
func (mc *MockContiv) GetServiceLocalEndpointWeight() uint8
GetServiceLocalEndpointWeight returns the load-balancing weight assigned to locally deployed service endpoints.
func (*MockContiv) GetTCPNATSessionTimeout ¶
func (mc *MockContiv) GetTCPNATSessionTimeout() uint32
GetTCPNATSessionTimeout returns NAT session timeout (in minutes) for TCP connections, used in case that CleanupIdleNATSessions is turned on.
func (*MockContiv) GetVxlanBVIIfName ¶
func (mc *MockContiv) GetVxlanBVIIfName() string
GetVxlanBVIIfName returns the name of an BVI interface facing towards VXLAN tunnels to other hosts. Returns an empty string if VXLAN is not used (in L2 interconnect mode).
func (*MockContiv) InSTNMode ¶
func (mc *MockContiv) InSTNMode() bool
InSTNMode returns true if Contiv operates in the STN mode (single interface for each node).
func (*MockContiv) IsTCPstackDisabled ¶
func (mc *MockContiv) IsTCPstackDisabled() bool
IsTCPstackDisabled returns true if the tcp stack is disabled and only veths are configured
func (*MockContiv) NatExternalTraffic ¶
func (mc *MockContiv) NatExternalTraffic() bool
NatExternalTraffic returns true if traffic with cluster-outside destination should be S-NATed with node IP before being sent out from the node.
func (*MockContiv) RegisterPodPostAddHook ¶
func (mc *MockContiv) RegisterPodPostAddHook(hook contiv.PodActionHook)
RegisterPodPostAddHook allows to register callback that will be run for each pod once it is added and before the CNI reply is sent.
func (*MockContiv) RegisterPodPreRemovalHook ¶
func (mc *MockContiv) RegisterPodPreRemovalHook(hook contiv.PodActionHook)
RegisterPodPreRemovalHook allows to register callback that will be run for each pod immediately before its removal.
func (*MockContiv) SetContainerIndex ¶
func (mc *MockContiv) SetContainerIndex(ci *containeridx.ConfigIndex)
SetContainerIndex allows to set index that contains configured containers
func (*MockContiv) SetDefaultInterface ¶
func (mc *MockContiv) SetDefaultInterface(ifName string, ifIP net.IP)
SetDefaultInterface allows to set what tests will assume the default interface IP and name are (both can be zero values).
func (*MockContiv) SetHostIPs ¶
func (mc *MockContiv) SetHostIPs(ips []net.IP)
SetHostIPs sets IP addresses of this node present in the host network namespace (Linux).
func (*MockContiv) SetHostInterconnectIfName ¶
func (mc *MockContiv) SetHostInterconnectIfName(ifName string)
SetHostInterconnectIfName allows to set what tests will assume the name of the host-interconnect interface is.
func (*MockContiv) SetMainPhysicalIfName ¶
func (mc *MockContiv) SetMainPhysicalIfName(ifName string)
SetMainPhysicalIfName allows to set what tests will assume the name of the main physical interface is.
func (*MockContiv) SetMainVrfID ¶
func (mc *MockContiv) SetMainVrfID(id uint32)
SetMainVrfID sets the ID of the main network connectivity VRF.
func (*MockContiv) SetNatExternalTraffic ¶
func (mc *MockContiv) SetNatExternalTraffic(natExternalTraffic bool)
SetNatExternalTraffic allows to set what tests will assume the state of SNAT is.
func (*MockContiv) SetNatLoopbackIP ¶
func (mc *MockContiv) SetNatLoopbackIP(natLoopIP string)
SetNatLoopbackIP allows to set what tests will assume the NAT loopback IP is.
func (*MockContiv) SetNodeIP ¶
func (mc *MockContiv) SetNodeIP(nodeIP string)
SetNodeIP allows to set what tests will assume the node IP is.
func (*MockContiv) SetOtherPhysicalIfNames ¶
func (mc *MockContiv) SetOtherPhysicalIfNames(ifs []string)
SetOtherPhysicalIfNames allows to set what tests will assume the list of other physical interface names is.
func (*MockContiv) SetPodAppNsIndex ¶
func (mc *MockContiv) SetPodAppNsIndex(pod podmodel.ID, nsIndex uint32)
SetPodAppNsIndex allows to create a fake association between a pod and a VPP application namespace index.
func (*MockContiv) SetPodIfName ¶
func (mc *MockContiv) SetPodIfName(pod podmodel.ID, ifName string)
SetPodIfName allows to create a fake association between a pod and an interface.
func (*MockContiv) SetPodNetwork ¶
func (mc *MockContiv) SetPodNetwork(podNetwork string)
SetPodNetwork allows to set what tests will assume as the pod subnet for the current host node.
func (*MockContiv) SetPodVrfID ¶
func (mc *MockContiv) SetPodVrfID(id uint32)
SetPodVrfID sets the ID of the POD VRF.
func (*MockContiv) SetSTNMode ¶
func (mc *MockContiv) SetSTNMode(stnMode bool)
SetSTNMode allows to set flag denoting if the STN is used or not.
func (*MockContiv) SetServiceLocalEndpointWeight ¶
func (mc *MockContiv) SetServiceLocalEndpointWeight(weight uint8)
ServiceLocalEndpointWeight allows to set what tests will assume the weight for load-balancing of locally deployed service endpoints is.
func (*MockContiv) SetTCPStackDisabled ¶
func (mc *MockContiv) SetTCPStackDisabled(tcpStackDisabled bool)
SetTCPStackDisabled allows to set flag denoting if the tcpStack is disabled or not.
func (*MockContiv) SetVxlanBVIIfName ¶
func (mc *MockContiv) SetVxlanBVIIfName(ifName string)
SetVxlanBVIIfName allows to set what tests will assume the name of the VXLAN BVI interface is.
func (*MockContiv) WatchNodeIP ¶
func (mc *MockContiv) WatchNodeIP(subscriber chan string)
WatchNodeIP adds given channel to the list of subscribers that are notified upon change of nodeIP address. If the channel is not ready to receive notification, the notification is dropped.