Documentation ¶
Index ¶
- Variables
- func HaveConnectivityTo(target connectionTarget, explicitPort ...uint16) types.GomegaMatcher
- type ConnectivityChecker
- func (c *ConnectivityChecker) ActualConnectivity() []string
- func (c *ConnectivityChecker) CheckConnectivity(optionalDescription ...interface{})
- func (c *ConnectivityChecker) CheckConnectivityOffset(offset int, optionalDescription ...interface{})
- func (c *ConnectivityChecker) CheckConnectivityWithTimeout(timeout time.Duration, optionalDescription ...interface{})
- func (c *ConnectivityChecker) CheckConnectivityWithTimeoutOffset(callerSkip int, timeout time.Duration, optionalDescription ...interface{})
- func (c *ConnectivityChecker) ExpectNone(from connectionSource, to connectionTarget, explicitPort ...uint16)
- func (c *ConnectivityChecker) ExpectSome(from connectionSource, to connectionTarget, explicitPort ...uint16)
- func (c *ConnectivityChecker) ExpectedConnectivity() []string
- func (c *ConnectivityChecker) ResetExpectations()
- type IP
- type PermanentConnection
- type Port
- type SideService
- type Workload
- func (w *Workload) CanConnectTo(ip, port, protocol string) bool
- func (w *Workload) Configure(client client.Interface)
- func (w *Workload) ConfigureInDatastore(infra infrastructure.DatastoreInfra)
- func (w *Workload) ExecOutput(args ...string) (string, error)
- func (w *Workload) IPNet() string
- func (w *Workload) LatencyTo(ip, port string) (time.Duration, string)
- func (w *Workload) NameSelector() string
- func (w *Workload) NamespaceID() string
- func (w *Workload) Port(port uint16) *Port
- func (w *Workload) RemoveFromDatastore(client client.Interface)
- func (w *Workload) SourceName() string
- func (w *Workload) StartPermanentConnection(ip string, port, sourcePort int) *PermanentConnection
- func (w *Workload) StartSideService() *SideService
- func (w *Workload) Stop()
- func (w *Workload) ToMatcher(explicitPort ...uint16) *connectivityMatcher
Constants ¶
This section is empty.
Variables ¶
var UnactivatedConnectivityCheckers = set.New()
Functions ¶
func HaveConnectivityTo ¶
func HaveConnectivityTo(target connectionTarget, explicitPort ...uint16) types.GomegaMatcher
Types ¶
type ConnectivityChecker ¶
type ConnectivityChecker struct { ReverseDirection bool Protocol string // "tcp" or "udp" // contains filtered or unexported fields }
ConnectivityChecker records a set of connectivity expectations and supports calculating the actual state of the connectivity between the given workloads. It is expected to be used like so:
var cc = &workload.ConnectivityChecker{} cc.ExpectNone(w[2], w[0], 1234) cc.ExpectSome(w[1], w[0], 5678) Eventually(cc.ActualConnectivity, "10s", "100ms").Should(Equal(cc.ExpectedConnectivity()))
Note that the ActualConnectivity method is passed to Eventually as a function pointer to allow Ginkgo to re-evaluate the result as needed.
func (*ConnectivityChecker) ActualConnectivity ¶
func (c *ConnectivityChecker) ActualConnectivity() []string
ActualConnectivity calculates the current connectivity for all the expected paths. One string is returned for each expectation, in the order they were recorded. The strings are intended to be human readable, and they are in the same order and format as those returned by ExpectedConnectivity().
func (*ConnectivityChecker) CheckConnectivity ¶
func (c *ConnectivityChecker) CheckConnectivity(optionalDescription ...interface{})
func (*ConnectivityChecker) CheckConnectivityOffset ¶
func (c *ConnectivityChecker) CheckConnectivityOffset(offset int, optionalDescription ...interface{})
func (*ConnectivityChecker) CheckConnectivityWithTimeout ¶
func (c *ConnectivityChecker) CheckConnectivityWithTimeout(timeout time.Duration, optionalDescription ...interface{})
func (*ConnectivityChecker) CheckConnectivityWithTimeoutOffset ¶
func (c *ConnectivityChecker) CheckConnectivityWithTimeoutOffset(callerSkip int, timeout time.Duration, optionalDescription ...interface{})
func (*ConnectivityChecker) ExpectNone ¶
func (c *ConnectivityChecker) ExpectNone(from connectionSource, to connectionTarget, explicitPort ...uint16)
func (*ConnectivityChecker) ExpectSome ¶
func (c *ConnectivityChecker) ExpectSome(from connectionSource, to connectionTarget, explicitPort ...uint16)
func (*ConnectivityChecker) ExpectedConnectivity ¶
func (c *ConnectivityChecker) ExpectedConnectivity() []string
ExpectedConnectivity returns one string per recorded expection in order, encoding the expected connectivity in the same format used by ActualConnectivity().
func (*ConnectivityChecker) ResetExpectations ¶
func (c *ConnectivityChecker) ResetExpectations()
type PermanentConnection ¶
func (*PermanentConnection) Stop ¶
func (pc *PermanentConnection) Stop()
type SideService ¶
func (*SideService) Stop ¶
func (s *SideService) Stop()
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" // contains filtered or unexported fields }
func Run ¶
func Run(c *infrastructure.Felix, name, profile, ip, ports, protocol string) (w *Workload)
func (*Workload) CanConnectTo ¶
func (*Workload) ConfigureInDatastore ¶
func (w *Workload) ConfigureInDatastore(infra infrastructure.DatastoreInfra)
func (*Workload) NameSelector ¶
func (*Workload) NamespaceID ¶
func (*Workload) RemoveFromDatastore ¶
func (*Workload) SourceName ¶
func (*Workload) StartPermanentConnection ¶
func (w *Workload) StartPermanentConnection(ip string, port, sourcePort int) *PermanentConnection
func (*Workload) StartSideService ¶
func (w *Workload) StartSideService() *SideService