controlplane

package
v1.4.23 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IpsetApply      string = "IPSETAPPLY"
	IpsetRemove     string = "IPSETREMOVE"
	PolicyApply     string = "POLICYAPPLY"
	PolicyRemove    string = "POLICYREMOVE"
	ListReference   string = "LISTREFERENCE"
	PolicyReference string = "POLICYREFERENCE"
)

Variables

This section is empty.

Functions

func DecodeNPMNetworkPolicies

func DecodeNPMNetworkPolicies(payload *bytes.Buffer) ([]*policies.NPMNetworkPolicy, error)

func DecodeStrings

func DecodeStrings(payload *bytes.Buffer) ([]string, error)

func EncodeControllerIPSets

func EncodeControllerIPSets(ipsets []*ControllerIPSets) (*bytes.Buffer, error)

func EncodeNPMNetworkPolicies

func EncodeNPMNetworkPolicies(netpols []*policies.NPMNetworkPolicy) (*bytes.Buffer, error)

func EncodeStrings

func EncodeStrings(names []string) (*bytes.Buffer, error)

Types

type ControllerIPSets

type ControllerIPSets struct {
	*ipsets.IPSetMetadata
	// IPPodMetadata is used for setMaps to store Ips and ports as keys
	// and podMetadata as value
	IPPodMetadata map[string]*dp.PodMetadata
	// MemberIPSets is used for listMaps to store child IP Sets
	MemberIPSets map[string]*ipsets.IPSetMetadata

	// NetPolReference holds networkpolicy names where this IPSet
	// is being referred as part of rules
	// NetpolReference is not used currently, depending on testing we may decide to keep it
	// or delete it
	NetPolReference map[string]struct{}
	// contains filtered or unexported fields
}

ControllerIPSets is used in fan-out design for controller pod to calculate and push to daemon pod

func DecodeControllerIPSets

func DecodeControllerIPSets(payload *bytes.Buffer) ([]*ControllerIPSets, error)

func NewControllerIPSets

func NewControllerIPSets(metadata *ipsets.IPSetMetadata) *ControllerIPSets

func (*ControllerIPSets) AddReference

func (c *ControllerIPSets) AddReference(referenceName, referenceType string)

func (*ControllerIPSets) CanDelete

func (c *ControllerIPSets) CanDelete() bool

CanDelete checks for references and members

func (*ControllerIPSets) DeleteReference

func (c *ControllerIPSets) DeleteReference(referenceName, referenceType string)

func (*ControllerIPSets) GetMetadata

func (c *ControllerIPSets) GetMetadata() *ipsets.IPSetMetadata

GetMetadata returns the metadata of the ipset

func (*ControllerIPSets) HasReferences

func (c *ControllerIPSets) HasReferences() bool

HasReferences checks if an ipset has references

Directories

Path Synopsis
controllers
v1
v2
Package translation converts NetworkPolicy object to policies.NPMNetworkPolicy object which contains necessary information to program dataplanes.
Package translation converts NetworkPolicy object to policies.NPMNetworkPolicy object which contains necessary information to program dataplanes.

Jump to

Keyboard shortcuts

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