Documentation ¶
Index ¶
- func NodePrettyPrint(rootNode Node) string
- func NodeTraverse(node Node, f func(Node, int))
- type Branch
- type Leaf
- type MatchExpression
- type MatchKeyValue
- type NamespaceSelector
- type Node
- func Reduce(policy *networkingv1.NetworkPolicy) Node
- func ReduceEgress(egress networkingv1.NetworkPolicyEgressRule) Node
- func ReduceEgresses(egresses []networkingv1.NetworkPolicyEgressRule) Node
- func ReduceIngress(ingress networkingv1.NetworkPolicyIngressRule) Node
- func ReduceIngresses(ingresses []networkingv1.NetworkPolicyIngressRule) Node
- func ReduceIpBlock(ipBlock *networkingv1.IPBlock) Node
- func ReduceMatchExpressions(exps []metav1.LabelSelectorRequirement) Node
- func ReduceMatchLabels(labels map[string]string) Node
- func ReduceNetworkPolicyPeer(isEgress bool, npp networkingv1.NetworkPolicyPeer) Node
- func ReducePodSelector(sel *metav1.LabelSelector) Node
- func ReducePorts(ports []networkingv1.NetworkPolicyPort) Node
- func ReduceSelector(sel metav1.LabelSelector) Node
- type Peer
- type Pod
- type Port
- type Reachability
- func (r *Reachability) AllowLoopback()
- func (r *Reachability) Expect(pod1 Pod, pod2 Pod, isConnected bool)
- func (r *Reachability) ExpectAllEgress(pod Pod, connected bool)
- func (r *Reachability) ExpectAllIngress(pod Pod, connected bool)
- func (r *Reachability) ExpectPeer(from *Peer, to *Peer, connected bool)
- func (r *Reachability) Observe(pod1 Pod, pod2 Pod, isConnected bool)
- func (r *Reachability) PrintSummary(printExpected bool, printObserved bool, printComparison bool)
- type StringTruthTable
- func (tt *StringTruthTable) Compare(other *StringTruthTable) *StringTruthTable
- func (tt *StringTruthTable) Get(from string, to string) string
- func (tt *StringTruthTable) IsComplete() bool
- func (tt *StringTruthTable) Set(from string, to string, value string)
- func (tt *StringTruthTable) SetAllFrom(from string, value string)
- func (tt *StringTruthTable) SetAllTo(to string, value string)
- func (tt *StringTruthTable) Table() *tablewriter.Table
- type TruthTable
- func (tt *TruthTable) Compare(other *TruthTable) *TruthTable
- func (tt *TruthTable) Get(from string, to string) bool
- func (tt *TruthTable) IsComplete() bool
- func (tt *TruthTable) PrettyPrint() string
- func (tt *TruthTable) Set(from string, to string, value bool)
- func (tt *TruthTable) SetAllFrom(from string, value bool)
- func (tt *TruthTable) SetAllTo(to string, value bool)
- func (tt *TruthTable) Table() *tablewriter.Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NodePrettyPrint ¶
func NodeTraverse ¶
Types ¶
type MatchExpression ¶
type MatchExpression metav1.LabelSelectorRequirement
func (*MatchExpression) Children ¶
func (me *MatchExpression) Children() []Node
func (*MatchExpression) Print ¶
func (me *MatchExpression) Print() string
type MatchKeyValue ¶
func (*MatchKeyValue) Children ¶
func (mkv *MatchKeyValue) Children() []Node
func (*MatchKeyValue) Print ¶
func (mkv *MatchKeyValue) Print() string
type NamespaceSelector ¶
func ReduceNamespaceSelector ¶
func ReduceNamespaceSelector(sel *metav1.LabelSelector) *NamespaceSelector
func (*NamespaceSelector) Children ¶
func (n *NamespaceSelector) Children() []Node
func (*NamespaceSelector) Print ¶
func (n *NamespaceSelector) Print() string
type Node ¶
func Reduce ¶
func Reduce(policy *networkingv1.NetworkPolicy) Node
func ReduceEgress ¶
func ReduceEgress(egress networkingv1.NetworkPolicyEgressRule) Node
func ReduceEgresses ¶
func ReduceEgresses(egresses []networkingv1.NetworkPolicyEgressRule) Node
func ReduceIngress ¶
func ReduceIngress(ingress networkingv1.NetworkPolicyIngressRule) Node
func ReduceIngresses ¶
func ReduceIngresses(ingresses []networkingv1.NetworkPolicyIngressRule) Node
func ReduceIpBlock ¶
func ReduceIpBlock(ipBlock *networkingv1.IPBlock) Node
func ReduceMatchExpressions ¶
func ReduceMatchExpressions(exps []metav1.LabelSelectorRequirement) Node
func ReduceMatchLabels ¶
func ReduceNetworkPolicyPeer ¶
func ReduceNetworkPolicyPeer(isEgress bool, npp networkingv1.NetworkPolicyPeer) Node
func ReducePodSelector ¶
func ReducePodSelector(sel *metav1.LabelSelector) Node
func ReducePorts ¶
func ReducePorts(ports []networkingv1.NetworkPolicyPort) Node
func ReduceSelector ¶
func ReduceSelector(sel metav1.LabelSelector) Node
type Reachability ¶
type Reachability struct { Expected *TruthTable Observed *TruthTable Pods []Pod }
func NewReachability ¶
func NewReachability(pods []Pod, defaultExpectation bool) *Reachability
func (*Reachability) AllowLoopback ¶
func (r *Reachability) AllowLoopback()
AllowLoopback is a convenience func to access Expected and re-enabl all loopback to true. in general call it after doing other logical stuff in loops since loopback logic follows no policy.
func (*Reachability) ExpectAllEgress ¶
func (r *Reachability) ExpectAllEgress(pod Pod, connected bool)
ExpectAllEgress defines that any traffic going out of the pod will be allowed/denied (true/false)
func (*Reachability) ExpectAllIngress ¶
func (r *Reachability) ExpectAllIngress(pod Pod, connected bool)
ExpectAllIngress defines that any traffic going into the pod will be allowed/denied (true/false)
func (*Reachability) ExpectPeer ¶
func (r *Reachability) ExpectPeer(from *Peer, to *Peer, connected bool)
func (*Reachability) PrintSummary ¶
func (r *Reachability) PrintSummary(printExpected bool, printObserved bool, printComparison bool)
type StringTruthTable ¶
type StringTruthTable struct { Froms []string Tos []string Values map[string]map[string]string // contains filtered or unexported fields }
func NewStringTruthTable ¶
func NewStringTruthTable(items []string) *StringTruthTable
func NewStringTruthTableWithDefaultValue ¶
func NewStringTruthTableWithDefaultValue(items []string, defaultValue string) *StringTruthTable
func NewStringTruthTableWithFromsTo ¶
func NewStringTruthTableWithFromsTo(froms []string, tos []string) *StringTruthTable
func (*StringTruthTable) Compare ¶
func (tt *StringTruthTable) Compare(other *StringTruthTable) *StringTruthTable
func (*StringTruthTable) IsComplete ¶
func (tt *StringTruthTable) IsComplete() bool
IsComplete returns true if there's a value set for every single pair of items, otherwise it returns false.
func (*StringTruthTable) Set ¶
func (tt *StringTruthTable) Set(from string, to string, value string)
func (*StringTruthTable) SetAllFrom ¶
func (tt *StringTruthTable) SetAllFrom(from string, value string)
func (*StringTruthTable) SetAllTo ¶
func (tt *StringTruthTable) SetAllTo(to string, value string)
func (*StringTruthTable) Table ¶
func (tt *StringTruthTable) Table() *tablewriter.Table
type TruthTable ¶
type TruthTable struct { Items []string Values map[string]map[string]bool // contains filtered or unexported fields }
func NewTruthTable ¶
func NewTruthTable(items []string, defaultValue *bool) *TruthTable
func (*TruthTable) Compare ¶
func (tt *TruthTable) Compare(other *TruthTable) *TruthTable
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) PrettyPrint ¶
func (tt *TruthTable) PrettyPrint() string
func (*TruthTable) SetAllFrom ¶
func (tt *TruthTable) SetAllFrom(from string, value bool)
func (*TruthTable) SetAllTo ¶
func (tt *TruthTable) SetAllTo(to string, value bool)
func (*TruthTable) Table ¶
func (tt *TruthTable) Table() *tablewriter.Table
Source Files ¶
Click to show internal directories.
Click to hide internal directories.