Documentation ¶
Index ¶
- type MockContiv
- func (mc *MockContiv) DeletingPod(podID podmodel.ID)
- func (mc *MockContiv) GetContainerIndex() containeridx.Reader
- func (mc *MockContiv) GetDefaultGatewayIP() 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) GetNodeIP() (net.IP, *net.IPNet)
- func (mc *MockContiv) GetNsIndex(podNamespace string, podName string) (nsIndex uint32, exists bool)
- 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) GetVxlanBVIIfName() string
- func (mc *MockContiv) IsTCPstackDisabled() bool
- func (mc *MockContiv) NatExternalTraffic() bool
- func (mc *MockContiv) RegisterPodPreRemovalHook(hook contiv.PodActionHook)
- func (mc *MockContiv) SetContainerIndex(ci *containeridx.ConfigIndex)
- func (mc *MockContiv) SetDefaultGatewayIP(gwIP net.IP)
- func (mc *MockContiv) SetHostInterconnectIfName(ifName string)
- func (mc *MockContiv) SetMainPhysicalIfName(ifName string)
- func (mc *MockContiv) SetNatExternalTraffic(natExternalTraffic bool)
- 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) 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) 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) GetDefaultGatewayIP ¶
func (mc *MockContiv) GetDefaultGatewayIP() net.IP
GetDefaultGatewayIP returns the IP address of the default gateway for external traffic. If the default GW is not configured, the function returns nil.
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) 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) 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) 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) 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) 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) SetDefaultGatewayIP ¶
func (mc *MockContiv) SetDefaultGatewayIP(gwIP net.IP)
SetDefaultGatewayIP allows to set what tests will assume the default gateway IP is (can be nil).
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) SetNatExternalTraffic ¶
func (mc *MockContiv) SetNatExternalTraffic(natExternalTraffic bool)
SetNatExternalTraffic allows to set what tests will assume the state of SNAT 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) 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.