Documentation ¶
Overview ¶
Package common contains the OpenShift SDN code that is shared between master, node, and proxy
Index ¶
- func CheckDNSResolver() error
- func ClusterNetworkToString(n *networkapi.ClusterNetwork) string
- func DeletionHandlingMetaNamespaceKeyFunc(obj interface{}) (string, error)
- func HostSubnetToString(subnet *networkapi.HostSubnet) string
- func RegisterSharedInformerEventHandlers(kubeInformers kinternalinformers.SharedInformerFactory, ...)
- func RunEventQueue(client kcache.Getter, resourceName ResourceName, process ProcessEventFunc)
- type DNS
- type EgressDNS
- func (e *EgressDNS) Add(policy networkapi.EgressNetworkPolicy)
- func (e *EgressDNS) Delete(policy networkapi.EgressNetworkPolicy)
- func (e *EgressDNS) GetIPs(policy networkapi.EgressNetworkPolicy, dnsName string) []net.IP
- func (e *EgressDNS) GetMinQueryTime() (time.Time, ktypes.UID, string, bool)
- func (e *EgressDNS) GetNetCIDRs(policy networkapi.EgressNetworkPolicy, dnsName string) []net.IPNet
- func (e *EgressDNS) Sync()
- func (e *EgressDNS) Update(policyUID ktypes.UID) (error, bool)
- type EgressDNSUpdate
- type EventQueue
- type NetworkInfo
- type ProcessEventFunc
- type ResourceName
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDNSResolver ¶
func CheckDNSResolver() error
func ClusterNetworkToString ¶
func ClusterNetworkToString(n *networkapi.ClusterNetwork) string
func HostSubnetToString ¶
func HostSubnetToString(subnet *networkapi.HostSubnet) string
func RegisterSharedInformerEventHandlers ¶
func RegisterSharedInformerEventHandlers(kubeInformers kinternalinformers.SharedInformerFactory, addOrUpdateFunc func(interface{}, interface{}, watch.EventType), delFunc func(interface{}), resourceName ResourceName)
RegisterSharedInformerEventHandlers registers addOrUpdateFunc and delFunc event handlers with kubernetes shared informers for the given resource name.
func RunEventQueue ¶
func RunEventQueue(client kcache.Getter, resourceName ResourceName, process ProcessEventFunc)
Run event queue for the given resource. The 'process' function is called repeatedly with each available cache.Delta that describes state changes to an object. If the process function returns an error queued changes for that object are dropped but processing continues with the next available object's cache.Deltas. The error is logged with call stack information.
NOTE: this function will handle DeletedFinalStateUnknown delta objects automatically, which may not always be what you want since the now-deleted object may be stale.
Types ¶
type EgressDNS ¶
type EgressDNS struct { // Report changes when there are dns updates Updates chan EgressDNSUpdate // contains filtered or unexported fields }
func NewEgressDNS ¶
func NewEgressDNS() *EgressDNS
func (*EgressDNS) Add ¶
func (e *EgressDNS) Add(policy networkapi.EgressNetworkPolicy)
func (*EgressDNS) Delete ¶
func (e *EgressDNS) Delete(policy networkapi.EgressNetworkPolicy)
func (*EgressDNS) GetIPs ¶
func (e *EgressDNS) GetIPs(policy networkapi.EgressNetworkPolicy, dnsName string) []net.IP
func (*EgressDNS) GetMinQueryTime ¶
func (*EgressDNS) GetNetCIDRs ¶
func (e *EgressDNS) GetNetCIDRs(policy networkapi.EgressNetworkPolicy, dnsName string) []net.IPNet
type EgressDNSUpdate ¶
type EventQueue ¶
EventQueue is an enhanced DeltaFIFO that provides reliable Deleted deltas even if no knownObjects store is given, and compresses multiple deltas to reduce duplicate events.
Without a store, DeltaFIFO will drop Deleted deltas when its queue is empty because the deleted object is not present in the queue and DeltaFIFO tries to protect against duplicate Deleted deltas resulting from Replace().
To get reliable deletion, a store must be provided, and EventQueue provides one if the caller does not.
func NewEventQueue ¶
func NewEventQueue(keyFunc cache.KeyFunc) *EventQueue
func NewEventQueueForStore ¶
func NewEventQueueForStore(keyFunc cache.KeyFunc, knownObjects cache.KeyListerGetter) *EventQueue
func (*EventQueue) Pop ¶
func (queue *EventQueue) Pop(process ProcessEventFunc, expectedType interface{}) (interface{}, error)
Process queued changes for an object. The 'process' function is called repeatedly with each available cache.Delta that describes state changes for that object. If the process function returns an error queued changes for that object are dropped but processing continues with the next available object's cache.Deltas. The error is logged with call stack information.
type NetworkInfo ¶
func GetNetworkInfo ¶
func GetNetworkInfo(osClient *osclient.Client) (*NetworkInfo, error)
func ParseNetworkInfo ¶
func ParseNetworkInfo(clusterNetwork string, serviceNetwork string) (*NetworkInfo, error)
func (*NetworkInfo) CheckClusterObjects ¶
func (ni *NetworkInfo) CheckClusterObjects(subnets []networkapi.HostSubnet, pods []kapi.Pod, services []kapi.Service) error
func (*NetworkInfo) CheckHostNetworks ¶
func (ni *NetworkInfo) CheckHostNetworks(hostIPNets []*net.IPNet) error
func (*NetworkInfo) ValidateNodeIP ¶
func (ni *NetworkInfo) ValidateNodeIP(nodeIP string) error
type ProcessEventFunc ¶
Function should process one object delta, which represents a change notification for a single object. Function is passed the delta, which contains the changed object or the deleted final object state. The deleted final object state is extracted from the DeletedFinalStateUnknown passed by DeltaFIFO.
type ResourceName ¶
type ResourceName string
const ( Nodes ResourceName = "Nodes" Namespaces ResourceName = "Namespaces" NetNamespaces ResourceName = "NetNamespaces" Services ResourceName = "Services" HostSubnets ResourceName = "HostSubnets" Pods ResourceName = "Pods" EgressNetworkPolicies ResourceName = "EgressNetworkPolicies" NetworkPolicies ResourceName = "NetworkPolicies" )