connectivity

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSyntheticResources added in v0.1.0

func GetSyntheticResources(kubernetes *kube.Kubernetes, kubeResources *connectivitykube.Resources) (*synthetic.Resources, error)

func PrintNetworkPolicy added in v0.1.0

func PrintNetworkPolicy(p *networkingv1.NetworkPolicy) string

func SetupCluster

func SetupCluster(kubernetes *kube.Kubernetes, kubeResources *connectivitykube.Resources) error

func SetupClusterTODODelete added in v0.1.0

func SetupClusterTODODelete(kubernetes *kube.Kubernetes, namespaces []string, pods []string, port int, protocol v1.Protocol) (*connectivitykube.Resources, *synthetic.Resources, error)

Types

type Interpreter added in v0.1.0

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

func NewInterpreter added in v0.1.0

func NewInterpreter(kubernetes *kube.Kubernetes, namespaces []string, pods []string, ports []int, protocols []v1.Protocol, resetClusterBeforeTestCase bool, kubeProbeRetries int) (*Interpreter, error)

func (*Interpreter) ExecuteTestCase added in v0.1.0

func (t *Interpreter) ExecuteTestCase(testCase *generator.TestCase) *Result

type MultipleContextTestCase added in v0.1.0

type MultipleContextTestCase struct {
	KubePolicies              []*networkingv1.NetworkPolicy
	NetpolCreationWaitSeconds int
	Port                      int
	Protocol                  v1.Protocol
	KubeClients               map[string]*kube.Kubernetes
	KubeResources             map[string]*connectivitykube.Resources
	SyntheticResources        *synthetic.Resources
	NamespacesToClean         []string
	Policy                    *matcher.Policy
}

type MultipleContextTestCasePrinter added in v0.1.0

type MultipleContextTestCasePrinter struct {
	Noisy            bool
	IgnoreLoopback   bool
	Contexts         []string
	DifferenceCounts [][]int
}

func (*MultipleContextTestCasePrinter) PrintFinish added in v0.1.0

func (t *MultipleContextTestCasePrinter) PrintFinish()

func (*MultipleContextTestCasePrinter) PrintTestCaseResult added in v0.1.0

func (t *MultipleContextTestCasePrinter) PrintTestCaseResult(result *MultipleContextTestCaseResult)

type MultipleContextTestCaseResult added in v0.1.0

type MultipleContextTestCaseResult struct {
	TestCase        *MultipleContextTestCase
	SyntheticResult *synthetic.Result
	KubeResults     map[string]*connectivitykube.Results
	Errors          []error
}

type MultipleContextTester added in v0.1.0

type MultipleContextTester struct{}

func NewMultipleContextTester added in v0.1.0

func NewMultipleContextTester() *MultipleContextTester

func (*MultipleContextTester) TestNetworkPolicy added in v0.1.0

type Printer added in v0.1.0

type Printer struct {
	Noisy          bool
	IgnoreLoopback bool
	Results        []*Result
}

func (*Printer) PrintStep added in v0.1.0

func (t *Printer) PrintStep(i int, step *generator.TestStep, stepResult *StepResult)

func (*Printer) PrintSummary added in v0.1.0

func (t *Printer) PrintSummary()

func (*Printer) PrintTestCaseResult added in v0.1.0

func (t *Printer) PrintTestCaseResult(result *Result)

type Result added in v0.1.0

type Result struct {
	TestCase *generator.TestCase
	Steps    []*StepResult
	Err      error
}

type StepResult added in v0.1.0

type StepResult struct {
	SyntheticResult *synthetic.Result
	KubeResults     []*connectivitykube.Results
	Policy          *matcher.Policy
	KubePolicies    []*networkingv1.NetworkPolicy
}

func (*StepResult) LastKubeResult added in v0.1.0

func (s *StepResult) LastKubeResult() *connectivitykube.Results

type TestCaseState added in v0.1.0

type TestCaseState struct {
	Kubernetes *kube.Kubernetes
	Resources  *synthetic.Resources
	Policies   []*networkingv1.NetworkPolicy
}

func (*TestCaseState) CreatePolicy added in v0.1.0

func (t *TestCaseState) CreatePolicy(policy *networkingv1.NetworkPolicy) error

func (*TestCaseState) DeletePolicy added in v0.1.0

func (t *TestCaseState) DeletePolicy(ns string, name string) error

func (*TestCaseState) ReadPolicies added in v0.1.0

func (t *TestCaseState) ReadPolicies(namespaces []string) error

func (*TestCaseState) SetNamespaceLabels added in v0.1.0

func (t *TestCaseState) SetNamespaceLabels(ns string, labels map[string]string) error

func (*TestCaseState) SetPodLabels added in v0.1.0

func (t *TestCaseState) SetPodLabels(ns string, pod string, labels map[string]string) error

func (*TestCaseState) UpdatePolicy added in v0.1.0

func (t *TestCaseState) UpdatePolicy(policy *networkingv1.NetworkPolicy) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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