cli

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: MIT Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ParseMode        = "parse"
	ExplainMode      = "explain"
	LintMode         = "lint"
	QueryTrafficMode = "query-traffic"
	QueryTargetMode  = "query-target"
	ProbeMode        = "probe"
)

Variables

Functions

func ExplainPolicies added in v0.2.0

func ExplainPolicies(explainedPolicies *matcher.Policy)

func Lint added in v0.2.1

func Lint(kubePolicies []*networkingv1.NetworkPolicy)

func ParsePolicies added in v0.4.0

func ParsePolicies(kubePolicies []*networkingv1.NetworkPolicy)

func ProbeSyntheticConnectivity added in v0.2.0

func ProbeSyntheticConnectivity(explainedPolicies *matcher.Policy, modelPath string, kubePods []v1.Pod, kubeNamespaces []v1.Namespace)

func QueryTargetHelper added in v0.3.1

func QueryTargetHelper(policies *matcher.Policy, pod *QueryTargetPod) (*matcher.Policy, *matcher.Policy)

func QueryTargets added in v0.2.0

func QueryTargets(explainedPolicies *matcher.Policy, podPath string, pods []*QueryTargetPod)

func QueryTraffic added in v0.2.0

func QueryTraffic(explainedPolicies *matcher.Policy, trafficPath string)

func RunAnalyzeCommand added in v0.2.0

func RunAnalyzeCommand(args *AnalyzeArgs)

func RunCompareCommand added in v0.1.0

func RunCompareCommand(args *CompareArgs)

func RunGenerateCommand added in v0.0.10

func RunGenerateCommand(args *GenerateArgs)

func RunProbeCommand added in v0.0.7

func RunProbeCommand(args *ProbeArgs)

func RunRootCommand

func RunRootCommand()

func RunVersionCommand added in v0.1.2

func RunVersionCommand()

func SetupAnalyzeCommand added in v0.2.0

func SetupAnalyzeCommand() *cobra.Command

func SetupCompareCommand added in v0.1.0

func SetupCompareCommand() *cobra.Command

func SetupGenerateCommand added in v0.0.10

func SetupGenerateCommand() *cobra.Command

func SetupProbeCommand added in v0.0.6

func SetupProbeCommand() *cobra.Command

func SetupRootCommand added in v0.0.6

func SetupRootCommand() *cobra.Command

func SetupVersionCommand added in v0.1.2

func SetupVersionCommand() *cobra.Command

Types

type AnalyzeArgs added in v0.2.0

type AnalyzeArgs struct {
	AllNamespaces      bool
	Namespaces         []string
	UseExamplePolicies bool
	PolicyPath         string
	Context            string
	SimplifyPolicies   bool

	Modes []string

	// traffic
	TrafficPath string

	// targets
	TargetPodPath string

	// synthetic probe
	ProbePath string
}

type CompareArgs added in v0.1.0

type CompareArgs struct {
	Noisy                     bool
	NetpolCreationWaitSeconds int
	Contexts                  []string
}

type GenerateArgs added in v0.0.10

type GenerateArgs struct {
	AllowDNS                  bool
	Noisy                     bool
	IgnoreLoopback            bool
	PerturbationWaitSeconds   int
	PodCreationTimeoutSeconds int
	Retries                   int
	Context                   string
	ServerPorts               []int
	ServerProtocols           []string
	ServerNamespaces          []string
	ServerPods                []string
	CleanupNamespaces         bool
	Include                   []string
	Exclude                   []string
	DestinationType           string
	Mock                      bool
	DryRun                    bool
	JobTimeoutSeconds         int
	JunitResultsFile          string
}

type ProbeArgs added in v0.0.3

type ProbeArgs struct {
	Noisy                     bool
	IgnoreLoopback            bool
	KubeContext               string
	PerturbationWaitSeconds   int
	PodCreationTimeoutSeconds int
	PolicyPath                string
	ProbeMode                 string
	JobTimeoutSeconds         int

	// what to probe on
	ProbeAllAvailable bool
	Ports             []string
	Protocols         []string

	// server setup
	ServerProtocols  []string
	ServerPorts      []int
	ServerNamespaces []string
	ServerPods       []string
}

type QueryTargetPod

type QueryTargetPod struct {
	Namespace string
	Labels    map[string]string
}

QueryTargetPod matches targets; targets exist in only a single namespace and can't be matched by namespace

label, therefore we match by exact namespace and by pod labels.

type RootFlags added in v0.2.0

type RootFlags struct {
	Verbosity string
}

type SyntheticProbeConnectivityConfig added in v0.0.3

type SyntheticProbeConnectivityConfig struct {
	Resources *probe.Resources
	Probes    []*generator.PortProtocol
}

Jump to

Keyboard shortcuts

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