utils

package
v0.12.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACNPRuleAppliedToSpec added in v0.12.0

type ACNPRuleAppliedToSpec struct {
	PodSelector         map[string]string
	NSSelector          map[string]string
	PodSelectorMatchExp *[]metav1.LabelSelectorRequirement
	NSSelectorMatchExp  *[]metav1.LabelSelectorRequirement
}

type ANPRuleAppliedToSpec added in v0.12.0

type ANPRuleAppliedToSpec struct {
	PodSelector         map[string]string
	PodSelectorMatchExp *[]metav1.LabelSelectorRequirement
}

type AntreaNetworkPolicySpecBuilder added in v0.10.0

type AntreaNetworkPolicySpecBuilder struct {
	Spec      secv1alpha1.NetworkPolicySpec
	Name      string
	Namespace string
}

func (*AntreaNetworkPolicySpecBuilder) AddEgress added in v0.10.0

func (b *AntreaNetworkPolicySpecBuilder) AddEgress(protoc v1.Protocol,
	port *int, portName *string, endPort *int32, cidr *string,
	podSelector map[string]string, nsSelector map[string]string,
	podSelectorMatchExp *[]metav1.LabelSelectorRequirement, nsSelectorMatchExp *[]metav1.LabelSelectorRequirement,
	ruleAppliedToSpecs []ANPRuleAppliedToSpec, action secv1alpha1.RuleAction, name string) *AntreaNetworkPolicySpecBuilder

func (*AntreaNetworkPolicySpecBuilder) AddEgressLogging added in v0.11.0

func (*AntreaNetworkPolicySpecBuilder) AddIngress added in v0.10.0

func (b *AntreaNetworkPolicySpecBuilder) AddIngress(protoc v1.Protocol,
	port *int, portName *string, endPort *int32, cidr *string,
	podSelector map[string]string, nsSelector map[string]string,
	podSelectorMatchExp *[]metav1.LabelSelectorRequirement, nsSelectorMatchExp *[]metav1.LabelSelectorRequirement,
	ruleAppliedToSpecs []ANPRuleAppliedToSpec, action secv1alpha1.RuleAction, name string) *AntreaNetworkPolicySpecBuilder

func (*AntreaNetworkPolicySpecBuilder) Get added in v0.10.0

func (*AntreaNetworkPolicySpecBuilder) GetAppliedToPeer added in v0.12.0

func (b *AntreaNetworkPolicySpecBuilder) GetAppliedToPeer(podSelector map[string]string,
	podSelectorMatchExp *[]metav1.LabelSelectorRequirement) secv1alpha1.NetworkPolicyPeer

func (*AntreaNetworkPolicySpecBuilder) SetAppliedToGroup added in v0.10.0

func (b *AntreaNetworkPolicySpecBuilder) SetAppliedToGroup(podSelector map[string]string,
	podSelectorMatchExp *[]metav1.LabelSelectorRequirement) *AntreaNetworkPolicySpecBuilder

func (*AntreaNetworkPolicySpecBuilder) SetName added in v0.10.0

func (*AntreaNetworkPolicySpecBuilder) SetPriority added in v0.10.0

func (*AntreaNetworkPolicySpecBuilder) SetTier added in v0.10.0

type ClusterNetworkPolicySpecBuilder

type ClusterNetworkPolicySpecBuilder struct {
	Spec secv1alpha1.ClusterNetworkPolicySpec
	Name string
}

func (*ClusterNetworkPolicySpecBuilder) AddEgress

func (b *ClusterNetworkPolicySpecBuilder) AddEgress(protoc v1.Protocol,
	port *int, portName *string, endPort *int32, cidr *string,
	podSelector map[string]string, nsSelector map[string]string,
	podSelectorMatchExp *[]metav1.LabelSelectorRequirement, nsSelectorMatchExp *[]metav1.LabelSelectorRequirement,
	ruleAppliedToSpecs []ACNPRuleAppliedToSpec, action secv1alpha1.RuleAction, name string) *ClusterNetworkPolicySpecBuilder

func (*ClusterNetworkPolicySpecBuilder) AddEgressLogging added in v0.11.0

func (*ClusterNetworkPolicySpecBuilder) AddIngress

func (b *ClusterNetworkPolicySpecBuilder) AddIngress(protoc v1.Protocol,
	port *int, portName *string, endPort *int32, cidr *string,
	podSelector map[string]string, nsSelector map[string]string,
	podSelectorMatchExp *[]metav1.LabelSelectorRequirement, nsSelectorMatchExp *[]metav1.LabelSelectorRequirement,
	ruleAppliedToSpecs []ACNPRuleAppliedToSpec, action secv1alpha1.RuleAction, name string) *ClusterNetworkPolicySpecBuilder

func (*ClusterNetworkPolicySpecBuilder) Get

func (*ClusterNetworkPolicySpecBuilder) GetAppliedToPeer added in v0.12.0

func (b *ClusterNetworkPolicySpecBuilder) GetAppliedToPeer(podSelector map[string]string,
	nsSelector map[string]string,
	podSelectorMatchExp *[]metav1.LabelSelectorRequirement,
	nsSelectorMatchExp *[]metav1.LabelSelectorRequirement) secv1alpha1.NetworkPolicyPeer

func (*ClusterNetworkPolicySpecBuilder) SetAppliedToGroup

func (b *ClusterNetworkPolicySpecBuilder) SetAppliedToGroup(podSelector map[string]string,
	nsSelector map[string]string,
	podSelectorMatchExp *[]metav1.LabelSelectorRequirement,
	nsSelectorMatchExp *[]metav1.LabelSelectorRequirement) *ClusterNetworkPolicySpecBuilder

func (*ClusterNetworkPolicySpecBuilder) SetName

func (*ClusterNetworkPolicySpecBuilder) SetPriority

func (*ClusterNetworkPolicySpecBuilder) SetTier added in v0.9.0

func (*ClusterNetworkPolicySpecBuilder) WithEgressDNS

AddEgressDNS mutates the nth policy rule to allow DNS, convenience method

type NetworkPolicySpecBuilder

type NetworkPolicySpecBuilder struct {
	Spec      networkingv1.NetworkPolicySpec
	Name      string
	Namespace string
}

func (*NetworkPolicySpecBuilder) AddEgress

func (n *NetworkPolicySpecBuilder) AddEgress(protoc v1.Protocol, port *int, portName *string, cidr *string, exceptCIDRs []string, podSelector map[string]string, nsSelector map[string]string, podSelectorMatchExp *[]metav1.LabelSelectorRequirement, nsSelectorMatchExp *[]metav1.LabelSelectorRequirement) *NetworkPolicySpecBuilder

func (*NetworkPolicySpecBuilder) AddIngress

func (n *NetworkPolicySpecBuilder) AddIngress(protoc v1.Protocol, port *int, portName *string, cidr *string, exceptCIDRs []string, podSelector map[string]string, nsSelector map[string]string, podSelectorMatchExp *[]metav1.LabelSelectorRequirement, nsSelectorMatchExp *[]metav1.LabelSelectorRequirement) *NetworkPolicySpecBuilder

TODO: Add tests to match expressions

func (*NetworkPolicySpecBuilder) Get

func (*NetworkPolicySpecBuilder) SetName

func (n *NetworkPolicySpecBuilder) SetName(namespace string, name string) *NetworkPolicySpecBuilder

func (*NetworkPolicySpecBuilder) SetPodSelector

func (n *NetworkPolicySpecBuilder) SetPodSelector(labels map[string]string) *NetworkPolicySpecBuilder

func (*NetworkPolicySpecBuilder) SetTypeBoth

func (*NetworkPolicySpecBuilder) SetTypeEgress

func (*NetworkPolicySpecBuilder) SetTypeIngress

func (*NetworkPolicySpecBuilder) WithEgressDNS

AddEgressDNS mutates the nth policy rule to allow DNS, convenience method

Jump to

Keyboard shortcuts

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