utils

package
Version: v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACNPAppliedToSpec

type ACNPAppliedToSpec struct {
	PodSelector         map[string]string
	NSSelector          map[string]string
	PodSelectorMatchExp []metav1.LabelSelectorRequirement
	NSSelectorMatchExp  []metav1.LabelSelectorRequirement
	Group               string
}

type ANPAppliedToSpec

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

type AntreaNetworkPolicySpecBuilder

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

func (*AntreaNetworkPolicySpecBuilder) AddEgress

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

func (*AntreaNetworkPolicySpecBuilder) AddEgressLogging

func (*AntreaNetworkPolicySpecBuilder) AddIngress

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

func (*AntreaNetworkPolicySpecBuilder) Get

func (*AntreaNetworkPolicySpecBuilder) GetAppliedToPeer

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

func (*AntreaNetworkPolicySpecBuilder) GetLegacy

func (*AntreaNetworkPolicySpecBuilder) SetAppliedToGroup

func (*AntreaNetworkPolicySpecBuilder) SetName

func (*AntreaNetworkPolicySpecBuilder) SetPriority

func (*AntreaNetworkPolicySpecBuilder) SetTier

type ClusterGroupV1Alpha2SpecBuilder

type ClusterGroupV1Alpha2SpecBuilder struct {
	Spec crdv1alpha2.GroupSpec
	Name string
}

func (*ClusterGroupV1Alpha2SpecBuilder) Get

func (*ClusterGroupV1Alpha2SpecBuilder) GetLegacy

func (*ClusterGroupV1Alpha2SpecBuilder) SetChildGroups

func (*ClusterGroupV1Alpha2SpecBuilder) SetIPBlock

func (*ClusterGroupV1Alpha2SpecBuilder) SetIPBlocks

func (*ClusterGroupV1Alpha2SpecBuilder) SetName

func (*ClusterGroupV1Alpha2SpecBuilder) SetNamespaceSelector

func (b *ClusterGroupV1Alpha2SpecBuilder) SetNamespaceSelector(nsSelector map[string]string, nsSelectorMatchExp []metav1.LabelSelectorRequirement) *ClusterGroupV1Alpha2SpecBuilder

func (*ClusterGroupV1Alpha2SpecBuilder) SetPodSelector

func (b *ClusterGroupV1Alpha2SpecBuilder) SetPodSelector(podSelector map[string]string, podSelectorMatchExp []metav1.LabelSelectorRequirement) *ClusterGroupV1Alpha2SpecBuilder

func (*ClusterGroupV1Alpha2SpecBuilder) SetServiceReference

func (b *ClusterGroupV1Alpha2SpecBuilder) SetServiceReference(svcNS, svcName string) *ClusterGroupV1Alpha2SpecBuilder

type ClusterGroupV1Alpha3SpecBuilder

type ClusterGroupV1Alpha3SpecBuilder struct {
	Spec crdv1alpha3.GroupSpec
	Name string
}

ClusterGroupV1Alpha3SpecBuilder builds a core/v1alpha3 ClusterGroup object.

func (*ClusterGroupV1Alpha3SpecBuilder) Get

func (*ClusterGroupV1Alpha3SpecBuilder) SetChildGroups

func (*ClusterGroupV1Alpha3SpecBuilder) SetIPBlocks

func (*ClusterGroupV1Alpha3SpecBuilder) SetName

func (*ClusterGroupV1Alpha3SpecBuilder) SetNamespaceSelector

func (b *ClusterGroupV1Alpha3SpecBuilder) SetNamespaceSelector(nsSelector map[string]string, nsSelectorMatchExp []metav1.LabelSelectorRequirement) *ClusterGroupV1Alpha3SpecBuilder

func (*ClusterGroupV1Alpha3SpecBuilder) SetPodSelector

func (b *ClusterGroupV1Alpha3SpecBuilder) SetPodSelector(podSelector map[string]string, podSelectorMatchExp []metav1.LabelSelectorRequirement) *ClusterGroupV1Alpha3SpecBuilder

func (*ClusterGroupV1Alpha3SpecBuilder) SetServiceReference

func (b *ClusterGroupV1Alpha3SpecBuilder) SetServiceReference(svcNS, svcName string) *ClusterGroupV1Alpha3SpecBuilder

type ClusterNetworkPolicySpecBuilder

type ClusterNetworkPolicySpecBuilder struct {
	Spec crdv1alpha1.ClusterNetworkPolicySpec
	Name string
}

func (*ClusterNetworkPolicySpecBuilder) AddEgress

func (b *ClusterNetworkPolicySpecBuilder) AddEgress(protoc v1.Protocol,
	port *int32, portName *string, endPort *int32, cidr *string,
	podSelector map[string]string, nsSelector map[string]string,
	podSelectorMatchExp []metav1.LabelSelectorRequirement, nsSelectorMatchExp []metav1.LabelSelectorRequirement, selfNS bool,
	ruleAppliedToSpecs []ACNPAppliedToSpec, action crdv1alpha1.RuleAction, ruleClusterGroup, name string) *ClusterNetworkPolicySpecBuilder

func (*ClusterNetworkPolicySpecBuilder) AddEgressLogging

func (*ClusterNetworkPolicySpecBuilder) AddFQDNRule added in v1.3.0

func (b *ClusterNetworkPolicySpecBuilder) AddFQDNRule(fqdn string,
	protoc v1.Protocol, port *int32, portName *string, endPort *int32, name string,
	ruleAppliedToSpecs []ACNPAppliedToSpec, action crdv1alpha1.RuleAction) *ClusterNetworkPolicySpecBuilder

func (*ClusterNetworkPolicySpecBuilder) AddIngress

func (b *ClusterNetworkPolicySpecBuilder) AddIngress(protoc v1.Protocol,
	port *int32, portName *string, endPort *int32, cidr *string,
	podSelector map[string]string, nsSelector map[string]string,
	podSelectorMatchExp []metav1.LabelSelectorRequirement, nsSelectorMatchExp []metav1.LabelSelectorRequirement, selfNS bool,
	ruleAppliedToSpecs []ACNPAppliedToSpec, action crdv1alpha1.RuleAction, ruleClusterGroup, name string) *ClusterNetworkPolicySpecBuilder

func (*ClusterNetworkPolicySpecBuilder) Get

func (*ClusterNetworkPolicySpecBuilder) GetAppliedToPeer

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

func (*ClusterNetworkPolicySpecBuilder) GetLegacy

func (*ClusterNetworkPolicySpecBuilder) SetAppliedToGroup

func (*ClusterNetworkPolicySpecBuilder) SetName

func (*ClusterNetworkPolicySpecBuilder) SetPriority

func (*ClusterNetworkPolicySpecBuilder) SetTier

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 *int32, 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 *int32, 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
t or T : Toggle theme light dark auto
y or Y : Canonical URL