Documentation ¶
Index ¶
- Variables
- func KubeNamespace(ns string, labels map[string]string) *v1.Namespace
- type Connectivity
- type Container
- type Item
- type Job
- type JobBuilder
- func (j *JobBuilder) GetJobsAllAvailableServers(resources *Resources, mode generator.ProbeMode) *Jobs
- func (j *JobBuilder) GetJobsForNamedPortProtocol(resources *Resources, port intstr.IntOrString, protocol v1.Protocol, ...) *Jobs
- func (j *JobBuilder) GetJobsForProbeConfig(resources *Resources, config *generator.ProbeConfig) *Jobs
- type JobResult
- type JobRunner
- type Jobs
- type KubeBatchJobRunner
- type KubeJobRunner
- type Peer
- type Pod
- func (p *Pod) Host(probeMode generator.ProbeMode) string
- func (p *Pod) IsEqualToKubePod(kubePod v1.Pod) bool
- func (p *Pod) IsServingPortProtocol(port int, protocol v1.Protocol) bool
- func (p *Pod) KubeContainers() []v1.Container
- func (p *Pod) KubePod() *v1.Pod
- func (p *Pod) KubeService() *v1.Service
- func (p *Pod) PodString() PodString
- func (p *Pod) ResolveNamedPort(port string) (int, error)
- func (p *Pod) ResolveNumberedPort(port int) (string, error)
- func (p *Pod) ServiceName() string
- func (p *Pod) SetLabels(labels map[string]string) *Pod
- type PodString
- type Resources
- func (r *Resources) CreateNamespace(ns string, labels map[string]string) (*Resources, error)
- func (r *Resources) CreatePod(ns string, podName string, labels map[string]string) (*Resources, error)
- func (r *Resources) CreateResourcesInKube(kubernetes kube.IKubernetes) error
- func (r *Resources) DeleteNamespace(ns string) (*Resources, error)
- func (r *Resources) DeletePod(ns string, podName string) (*Resources, error)
- func (r *Resources) GetPod(ns string, name string) (*Pod, error)
- func (r *Resources) NamespacesSlice() []string
- func (r *Resources) RenderTable() string
- func (r *Resources) SetPodLabels(ns string, podName string, labels map[string]string) (*Resources, error)
- func (r *Resources) SortedPodNames() []string
- func (r *Resources) UpdateNamespaceLabels(ns string, labels map[string]string) (*Resources, error)
- type Runner
- type SimulatedJobRunner
- type Table
- type TableKey
- type TruthTable
- func (tt *TruthTable) Get(from string, to string) interface{}
- func (tt *TruthTable) GetKey(key *TableKey) interface{}
- func (tt *TruthTable) IsComplete() bool
- func (tt *TruthTable) Keys() []*TableKey
- func (tt *TruthTable) Set(from string, to string, value interface{})
- func (tt *TruthTable) Table(schema string, rowLine bool, ...) string
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Connectivity ¶
type Connectivity string
const ( ConnectivityUnknown Connectivity = "unknown" ConnectivityCheckFailed Connectivity = "checkfailed" ConnectivityInvalidNamedPort Connectivity = "invalidnamedport" ConnectivityInvalidPortProtocol Connectivity = "invalidportprotocol" ConnectivityBlocked Connectivity = "blocked" ConnectivityAllowed Connectivity = "allowed" )
func (Connectivity) ShortString ¶
func (p Connectivity) ShortString() string
type Container ¶
func NewDefaultContainer ¶
func (*Container) KubeContainer ¶
func (*Container) KubeServicePort ¶
func (c *Container) KubeServicePort() v1.ServicePort
type Item ¶ added in v0.2.4
func (*Item) AddJobResult ¶ added in v0.2.4
type Job ¶
type Job struct { FromKey string FromNamespace string FromNamespaceLabels map[string]string FromPod string FromPodLabels map[string]string FromContainer string FromIP string ToKey string ToHost string ToNamespace string ToNamespaceLabels map[string]string ToPodLabels map[string]string ToContainer string ToIP string ResolvedPort int ResolvedPortName string Protocol v1.Protocol TimeoutSeconds int }
func (*Job) ClientCommand ¶
func (*Job) KubeExecCommand ¶
type JobBuilder ¶ added in v0.4.4
type JobBuilder struct {
TimeoutSeconds int
}
func (*JobBuilder) GetJobsAllAvailableServers ¶ added in v0.4.4
func (j *JobBuilder) GetJobsAllAvailableServers(resources *Resources, mode generator.ProbeMode) *Jobs
func (*JobBuilder) GetJobsForNamedPortProtocol ¶ added in v0.4.4
func (j *JobBuilder) GetJobsForNamedPortProtocol(resources *Resources, port intstr.IntOrString, protocol v1.Protocol, mode generator.ProbeMode) *Jobs
func (*JobBuilder) GetJobsForProbeConfig ¶ added in v0.4.4
func (j *JobBuilder) GetJobsForProbeConfig(resources *Resources, config *generator.ProbeConfig) *Jobs
type JobResult ¶
type JobResult struct { Job *Job Ingress *Connectivity Egress *Connectivity Combined Connectivity }
type KubeBatchJobRunner ¶ added in v0.2.4
func NewKubeBatchJobRunner ¶ added in v0.2.4
func NewKubeBatchJobRunner(k8s kube.IKubernetes, workers int) *KubeBatchJobRunner
func (*KubeBatchJobRunner) RunJobs ¶ added in v0.2.4
func (k *KubeBatchJobRunner) RunJobs(jobs []*Job) []*JobResult
type KubeJobRunner ¶ added in v0.2.4
type KubeJobRunner struct { Kubernetes kube.IKubernetes Workers int }
func (*KubeJobRunner) RunJobs ¶ added in v0.2.4
func (k *KubeJobRunner) RunJobs(jobs []*Job) []*JobResult
type Peer ¶
Peer is used for matching pods by either or both of the pod's namespace and name.
type Pod ¶
type Pod struct { Namespace string Name string Labels map[string]string ServiceIP string IP string Containers []*Container }
func NewDefaultPod ¶
func (*Pod) IsServingPortProtocol ¶
func (*Pod) KubeContainers ¶
func (*Pod) KubeService ¶
func (*Pod) ServiceName ¶
type PodString ¶
type PodString string
PodString represents a namespace 'x' + pod 'a' as "x/a".
func NewPodString ¶
NewPodString instantiates a PodString from the given namespace and name.
type Resources ¶
func NewDefaultResources ¶
func (*Resources) CreateNamespace ¶ added in v0.2.4
CreateNamespace returns a new object with a new namespace. It should not affect the original Resources object.
func (*Resources) CreatePod ¶ added in v0.2.4
func (r *Resources) CreatePod(ns string, podName string, labels map[string]string) (*Resources, error)
CreatePod returns a new object with a new pod. It should not affect the original Resources object.
func (*Resources) CreateResourcesInKube ¶
func (r *Resources) CreateResourcesInKube(kubernetes kube.IKubernetes) error
func (*Resources) DeleteNamespace ¶ added in v0.2.4
DeleteNamespace returns a new object without the namespace. It should not affect the original Resources object.
func (*Resources) DeletePod ¶ added in v0.2.4
DeletePod returns a new object without the deleted pod. It should not affect the original Resources object.
func (*Resources) NamespacesSlice ¶
func (*Resources) RenderTable ¶
func (*Resources) SetPodLabels ¶
func (r *Resources) SetPodLabels(ns string, podName string, labels map[string]string) (*Resources, error)
UpdatePodLabel returns a new object with an updated pod. It should not affect the original Resources object.
func (*Resources) SortedPodNames ¶ added in v0.2.4
type Runner ¶ added in v0.2.4
type Runner struct { JobRunner JobRunner JobBuilder *JobBuilder }
func NewKubeBatchRunner ¶ added in v0.2.4
func NewKubeBatchRunner(kubernetes kube.IKubernetes, workers int, jobBuilder *JobBuilder) *Runner
func NewKubeRunner ¶ added in v0.2.4
func NewKubeRunner(kubernetes kube.IKubernetes, workers int, jobBuilder *JobBuilder) *Runner
func NewSimulatedRunner ¶ added in v0.2.4
func NewSimulatedRunner(policies *matcher.Policy, jobBuilder *JobBuilder) *Runner
func (*Runner) RunProbeForConfig ¶ added in v0.2.4
func (p *Runner) RunProbeForConfig(probeConfig *generator.ProbeConfig, resources *Resources) *Table
type SimulatedJobRunner ¶ added in v0.2.4
func (*SimulatedJobRunner) RunJob ¶ added in v0.2.4
func (s *SimulatedJobRunner) RunJob(job *Job) *JobResult
func (*SimulatedJobRunner) RunJobs ¶ added in v0.2.4
func (s *SimulatedJobRunner) RunJobs(jobs []*Job) []*JobResult
type Table ¶
type Table struct {
Wrapped *TruthTable
}
func NewTableFromJobResults ¶ added in v0.2.4
func (*Table) RenderEgress ¶ added in v0.2.4
func (*Table) RenderIngress ¶ added in v0.2.4
func (*Table) RenderTable ¶
type TruthTable ¶
type TruthTable struct { Froms []string Tos []string Values map[string]map[string]interface{} // contains filtered or unexported fields }
TruthTable takes in n items and maintains an n x n table of booleans for each ordered pair
func NewTruthTable ¶
func NewTruthTable(froms []string, tos []string, defaultValue func(fr, to string) interface{}) *TruthTable
NewTruthTable creates a new truth table with froms and tos
func NewTruthTableFromItems ¶
func NewTruthTableFromItems(items []string, defaultValue func(fr, to string) interface{}) *TruthTable
NewTruthTableFromItems creates a new truth table with items
func (*TruthTable) Get ¶
func (tt *TruthTable) Get(from string, to string) interface{}
Get gets the specified value
func (*TruthTable) GetKey ¶
func (tt *TruthTable) GetKey(key *TableKey) interface{}
func (*TruthTable) IsComplete ¶
func (tt *TruthTable) IsComplete() bool
IsComplete returns true if there's a value set for every single pair of items, otherwise it returns false.
func (*TruthTable) Keys ¶
func (tt *TruthTable) Keys() []*TableKey
func (*TruthTable) Set ¶
func (tt *TruthTable) Set(from string, to string, value interface{})
Set sets the value for from->to