Documentation
¶
Index ¶
- Variables
- type IPSet
- type IPSetManager
- func (iMgr *IPSetManager) AddReference(setName, referenceName string, referenceType ReferenceType) error
- func (iMgr *IPSetManager) AddToList(listName string, setNames []string) error
- func (iMgr *IPSetManager) AddToSet(addToSets []string, ip, podKey string) error
- func (iMgr *IPSetManager) ApplyIPSets(networkID string) error
- func (iMgr *IPSetManager) CreateIPSet(setName string, setType SetType)
- func (iMgr *IPSetManager) DeleteIPSet(name string)
- func (iMgr *IPSetManager) DeleteReference(setName, referenceName string, referenceType ReferenceType) error
- func (iMgr *IPSetManager) GetIPSet(name string) *IPSet
- func (iMgr *IPSetManager) GetIPsFromSelectorIPSets(setList map[string]struct{}) (map[string]struct{}, error)
- func (iMgr *IPSetManager) GetSelectorReferencesBySet(setName string) (map[string]struct{}, error)
- func (iMgr *IPSetManager) RemoveFromList(listName string, setNames []string) error
- func (iMgr *IPSetManager) RemoveFromSet(removeFromSets []string, ip, podKey string) error
- type IPSetMode
- type ReferenceType
- type SetKind
- type SetProperties
- type SetType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrIPSetInvalidKind is returned when IPSet kind is invalid ErrIPSetInvalidKind = errors.New("invalid IPSet Kind") )
Functions ¶
This section is empty.
Types ¶
type IPSet ¶
type IPSet struct {
Name string
HashedName string
// SetProperties embedding set properties
SetProperties
// IpPodKey is used for setMaps to store Ips and ports as keys
// and podKey as value
IPPodKey map[string]string
// This is used for listMaps to store child IP Sets
MemberIPSets map[string]*IPSet
// Using a map to emulate set and value as struct{} for
// minimal memory consumption
// SelectorReference holds networkpolicy names where this IPSet
// is being used in PodSelector and NameSpace
SelectorReference map[string]struct{}
// NetPolReference holds networkpolicy names where this IPSet
// is being referred as part of rules
NetPolReference map[string]struct{}
// contains filtered or unexported fields
}
func (*IPSet) GetSetContents ¶
func (*IPSet) ShallowCompare ¶
ShallowCompare check if the properties of IPSets are same
type IPSetManager ¶
func NewIPSetManager ¶
func NewIPSetManager(networkName string) *IPSetManager
func (*IPSetManager) AddReference ¶
func (iMgr *IPSetManager) AddReference(setName, referenceName string, referenceType ReferenceType) error
func (*IPSetManager) AddToList ¶ added in v1.4.13
func (iMgr *IPSetManager) AddToList(listName string, setNames []string) error
func (*IPSetManager) AddToSet ¶ added in v1.4.13
func (iMgr *IPSetManager) AddToSet(addToSets []string, ip, podKey string) error
func (*IPSetManager) ApplyIPSets ¶
func (iMgr *IPSetManager) ApplyIPSets(networkID string) error
func (*IPSetManager) CreateIPSet ¶ added in v1.4.13
func (iMgr *IPSetManager) CreateIPSet(setName string, setType SetType)
func (*IPSetManager) DeleteIPSet ¶
func (iMgr *IPSetManager) DeleteIPSet(name string)
func (*IPSetManager) DeleteReference ¶
func (iMgr *IPSetManager) DeleteReference(setName, referenceName string, referenceType ReferenceType) error
func (*IPSetManager) GetIPSet ¶
func (iMgr *IPSetManager) GetIPSet(name string) *IPSet
func (*IPSetManager) GetIPsFromSelectorIPSets ¶ added in v1.4.13
func (iMgr *IPSetManager) GetIPsFromSelectorIPSets(setList map[string]struct{}) (map[string]struct{}, error)
func (*IPSetManager) GetSelectorReferencesBySet ¶ added in v1.4.13
func (iMgr *IPSetManager) GetSelectorReferencesBySet(setName string) (map[string]struct{}, error)
func (*IPSetManager) RemoveFromList ¶
func (iMgr *IPSetManager) RemoveFromList(listName string, setNames []string) error
func (*IPSetManager) RemoveFromSet ¶ added in v1.4.13
func (iMgr *IPSetManager) RemoveFromSet(removeFromSets []string, ip, podKey string) error
type ReferenceType ¶
type ReferenceType string
ReferenceType specifies the kind of reference for an IPSet
const ( SelectorType ReferenceType = "Selector" NetPolType ReferenceType = "NetPol" )
Possible ReferenceTypes
type SetProperties ¶
type SetType ¶
type SetType int8
const ( // Unknown SetType Unknown SetType = 0 // NameSpace IPSet is created to hold // ips of pods in a given NameSapce NameSpace SetType = 1 // KeyLabelOfNameSpace IPSet is a list kind ipset // with members as ipsets of namespace with this Label Key KeyLabelOfNameSpace SetType = 2 // KeyValueLabelOfNameSpace IPSet is a list kind ipset // with members as ipsets of namespace with this Label KeyValueLabelOfNameSpace SetType = 3 // KeyLabelOfPod IPSet contains IPs of Pods with this Label Key KeyLabelOfPod SetType = 4 // KeyValueLabelOfPod IPSet contains IPs of Pods with this Label KeyValueLabelOfPod SetType = 5 // NamedPorts IPSets contains a given namedport NamedPorts SetType = 6 // NestedLabelOfPod is derived for multivalue matchexpressions NestedLabelOfPod SetType = 7 // CIDRBlocks holds CIDR blocks CIDRBlocks SetType = 8 )
Click to show internal directories.
Click to hide internal directories.