Documentation ¶
Index ¶
- type Opt
- type PersistentConnectionOpts
- type Port
- func (p *Port) CanConnectTo(ip, port, protocol string, opts ...connectivity.CheckOption) *connectivity.Result
- func (p *Port) PreRetryCleanup(ip, port, protocol string, opts ...connectivity.CheckOption)
- func (p *Port) SourceIPs() []string
- func (p *Port) SourceName() string
- func (p *Port) ToMatcher(explicitPort ...uint16) *connectivity.Matcher
- type SideService
- type SpoofedWorkload
- type Workload
- func (w *Workload) AddSpoofInterface()
- func (w *Workload) AttachTCPDump() *tcpdump.TCPDump
- func (w *Workload) CanConnectTo(ip, port, protocol string, opts ...connectivity.CheckOption) *connectivity.Result
- func (w *Workload) Configure(client client.Interface)
- func (w *Workload) ConfigureInInfra(infra infrastructure.DatastoreInfra)
- func (w *Workload) ConfigureInInfraAsSpoofInterface(infra infrastructure.DatastoreInfra)
- func (w *Workload) ConfigureOtherWEPInInfraAsSpoofInterface(infra infrastructure.DatastoreInfra)
- func (w *Workload) Exec(args ...string)
- func (w *Workload) ExecCombinedOutput(args ...string) (string, error)
- func (w *Workload) ExecOutput(args ...string) (string, error)
- func (w *Workload) GetIP() string
- func (w *Workload) GetInterfaceName() string
- func (w *Workload) GetSpoofInterfaceName() string
- func (w *Workload) IPNet() string
- func (w *Workload) InterfaceIndex() int
- func (w *Workload) LatencyTo(ip, port string) (time.Duration, string)
- func (w *Workload) NameSelector() string
- func (w *Workload) NamespaceID() string
- func (w *Workload) NamespacePath() string
- func (w *Workload) PathMTU(ip string) (int, error)
- func (w *Workload) Port(port uint16) *Port
- func (w *Workload) PreRetryCleanup(ip, port, protocol string, opts ...connectivity.CheckOption)
- func (w *Workload) RemoveFromDatastore(client client.Interface)
- func (w *Workload) RemoveFromInfra(infra infrastructure.DatastoreInfra)
- func (w *Workload) RemoveSpoofWEPFromInfra(infra infrastructure.DatastoreInfra)
- func (w *Workload) RunCmd(cmd string, args ...string) (string, error)
- func (w *Workload) Runs() bool
- func (w *Workload) SendPacketsTo(ip string, count int, size int) (error, string)
- func (w *Workload) SourceIPs() []string
- func (w *Workload) SourceName() string
- func (w *Workload) Start() error
- func (w *Workload) StartPersistentConnection(ip string, port int, opts PersistentConnectionOpts) *connectivity.PersistentConnection
- func (w *Workload) StartSideService() *SideService
- func (w *Workload) Stop()
- func (w *Workload) ToMatcher(explicitPort ...uint16) *connectivity.Matcher
- func (w *Workload) UseSpoofInterface(spoof bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Port ¶
func (*Port) CanConnectTo ¶
func (p *Port) CanConnectTo(ip, port, protocol string, opts ...connectivity.CheckOption) *connectivity.Result
Return if a connection is good and packet loss string "PacketLoss[xx]". If it is not a packet loss test, packet loss string is "".
func (*Port) PreRetryCleanup ¶
func (p *Port) PreRetryCleanup(ip, port, protocol string, opts ...connectivity.CheckOption)
func (*Port) SourceName ¶
type SideService ¶
func (*SideService) Stop ¶
func (s *SideService) Stop()
type SpoofedWorkload ¶
func (*SpoofedWorkload) CanConnectTo ¶
func (s *SpoofedWorkload) CanConnectTo(ip, port, protocol string, opts ...connectivity.CheckOption) *connectivity.Result
func (*SpoofedWorkload) PreRetryCleanup ¶
func (s *SpoofedWorkload) PreRetryCleanup(ip, port, protocol string, opts ...connectivity.CheckOption)
type Workload ¶
type Workload struct { C *containers.Container Name string InterfaceName string IP string Ports string DefaultPort string WorkloadEndpoint *api.WorkloadEndpoint Protocol string // "tcp" or "udp" SpoofInterfaceName string SpoofName string SpoofWorkloadEndpoint *api.WorkloadEndpoint MTU int // contains filtered or unexported fields }
func New ¶
func New(c *infrastructure.Felix, name, profile, ip, ports, protocol string, opts ...Opt) *Workload
func Run ¶
func Run(c *infrastructure.Felix, name, profile, ip, ports, protocol string, opts ...Opt) (w *Workload)
func (*Workload) AddSpoofInterface ¶
func (w *Workload) AddSpoofInterface()
AddSpoofInterface adds a second interface to the workload with name Workload.SpoofIfaceName and moves the workload's IP to its loopback so that we can maintain a TCP connection while moving routes between the two interfaces. From the host's point of view, this looks like one interface is trying to hijack the connection of the other.
func (*Workload) AttachTCPDump ¶
AttachTCPDump returns tcpdump attached to the workload
func (*Workload) CanConnectTo ¶
func (w *Workload) CanConnectTo(ip, port, protocol string, opts ...connectivity.CheckOption) *connectivity.Result
func (*Workload) Configure ¶
Configure creates a workload endpoint in the datastore. Deprecated: should use ConfigureInInfra.
func (*Workload) ConfigureInInfra ¶
func (w *Workload) ConfigureInInfra(infra infrastructure.DatastoreInfra)
ConfigureInInfra creates the workload endpoint for this Workload.
func (*Workload) ConfigureInInfraAsSpoofInterface ¶
func (w *Workload) ConfigureInInfraAsSpoofInterface(infra infrastructure.DatastoreInfra)
ConfigureInInfraAsSpoofInterface creates a valid workload endpoint for this Workload, using the spoof interface added with AddSpoofInterface. After calling AddSpoofInterface(), UseSpoofInterface(true), and, this method, connectivity should work because the workload and felix will agree on the interface that should be used.
func (*Workload) ConfigureOtherWEPInInfraAsSpoofInterface ¶
func (w *Workload) ConfigureOtherWEPInInfraAsSpoofInterface(infra infrastructure.DatastoreInfra)
ConfigureOtherWEPInInfraAsSpoofInterface creates a WEP for the spoof interface that does not match this Workload's IP address.
func (*Workload) ExecCombinedOutput ¶
func (*Workload) GetInterfaceName ¶
func (*Workload) GetSpoofInterfaceName ¶
func (*Workload) InterfaceIndex ¶
func (*Workload) NameSelector ¶
func (*Workload) NamespaceID ¶
func (*Workload) NamespacePath ¶
func (*Workload) PreRetryCleanup ¶
func (w *Workload) PreRetryCleanup(ip, port, protocol string, opts ...connectivity.CheckOption)
func (*Workload) RemoveFromDatastore ¶
RemoveFromDatastore removes the workload endpoint from the datastore. Deprecated: should use RemoveFromInfra.
func (*Workload) RemoveFromInfra ¶
func (w *Workload) RemoveFromInfra(infra infrastructure.DatastoreInfra)
RemoveFromInfra removes the WEP created by ConfigureInInfra.
func (*Workload) RemoveSpoofWEPFromInfra ¶
func (w *Workload) RemoveSpoofWEPFromInfra(infra infrastructure.DatastoreInfra)
RemoveSpoofWEPFromInfra removes the spoof WEP created by ConfigureInInfraAsSpoofInterface or ConfigureOtherWEPInInfraAsSpoofInterface.
func (*Workload) SendPacketsTo ¶
func (*Workload) SourceName ¶
func (*Workload) StartPersistentConnection ¶
func (w *Workload) StartPersistentConnection(ip string, port int, opts PersistentConnectionOpts) *connectivity.PersistentConnection
func (*Workload) StartSideService ¶
func (w *Workload) StartSideService() *SideService
func (*Workload) ToMatcher ¶
func (w *Workload) ToMatcher(explicitPort ...uint16) *connectivity.Matcher