Documentation ¶
Overview ¶
Package synced provides tools for tracking if k8s resources have been initially sychronized with the k8s apiserver.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // AgentCRDResourceNames is a list of all CRD resource names // the Cilium agent needs to wait to be registered before // initializing any k8s watchers. AgentCRDResourceNames = []string{ crdResourceName(v2.CNPName), crdResourceName(v2.CCNPName), crdResourceName(v2.CEPName), crdResourceName(v2.CNName), crdResourceName(v2.CIDName), crdResourceName(v2.CLRPName), crdResourceName(v2alpha1.CENPName), } // AllCRDResourceNames is a list of all CRD resource names // Cilium Operator is registering. AllCRDResourceNames = append([]string{ crdResourceName(v2.CEWName), }, AgentCRDResourceNames...) )
Functions ¶
Types ¶
type APIGroups ¶
APIGroups is a lockable map to hold which k8s API Groups we have enabled/in-use Note: We can replace it with a Go 1.9 map once we require that version
type Resources ¶
Resources maps resource names to channels that are closed upon initial sync with k8s.
func (*Resources) BlockWaitGroupToSyncResources ¶
func (r *Resources) BlockWaitGroupToSyncResources( stop <-chan struct{}, swg *lock.StoppableWaitGroup, hasSyncedFunc cache.InformerSynced, resourceName string, )
BlockWaitGroupToSyncResources ensures that anything which waits on waitGroup waits until all objects of the specified resource stored in Kubernetes are received by the informer and processed by controller. Fatally exits if syncing these initial objects fails. If the given stop channel is closed, it does not fatal. Once the k8s caches are synced against k8s, k8sCacheSynced is also closed.
func (*Resources) CancelWaitGroupToSyncResources ¶
func (*Resources) WaitForCacheSync ¶
WaitForCacheSync waits for all K8s resources represented by resourceNames to have their K8s caches synchronized.