Documentation ¶
Index ¶
- func PropsAndTagsFromLabels(labels map[string]string) (map[string]string, map[string]bool)
- type CachedPod
- type CachedService
- type PodCache
- func (pc *PodCache) AddPod(pod *v1.Pod)
- func (pc *PodCache) DeleteByKey(key types.UID)
- func (pc *PodCache) GetCachedPod(podUID types.UID) *CachedPod
- func (pc *PodCache) GetLabels(key types.UID) labels.Set
- func (pc *PodCache) GetOwnerReferences(key types.UID) []metav1.OwnerReference
- func (pc *PodCache) GetPodsInNamespace(namespace string) []types.UID
- func (pc *PodCache) IsCached(pod *v1.Pod) bool
- type ServiceCache
- func (sc *ServiceCache) AddService(svc *v1.Service) bool
- func (sc *ServiceCache) Delete(svc *v1.Service)
- func (sc *ServiceCache) DeleteByKey(svcUID types.UID) []types.UID
- func (sc *ServiceCache) GetMatchingServices(cachedPod *CachedPod) []string
- func (sc *ServiceCache) IsCached(svc *v1.Service) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CachedPod ¶
type CachedPod struct { UID types.UID LabelSet labels.Set OwnerReferences []metav1.OwnerReference Namespace string }
CachedPod is used for holding only the neccessary
type CachedService ¶
type CachedService struct { UID types.UID Name string Namespace string Selector labels.Selector // contains filtered or unexported fields }
CachedService is used for holding only the neccesarry fields we need for label syncing
type PodCache ¶
type PodCache struct {
// contains filtered or unexported fields
}
PodCache is used for holding values we care about from a pod for quicker lookup than querying the API for them each time.
func (*PodCache) AddPod ¶
AddPod adds or updates a pod in cache This function should only be called after pc.IsCached to prevent unneccesary updates to the internal cache.
func (*PodCache) DeleteByKey ¶
DeleteByKey removes a pod from the cache given a UID
func (*PodCache) GetCachedPod ¶
GetCachedPod returns a CachedPod object from the cache if it exists
func (*PodCache) GetOwnerReferences ¶
func (pc *PodCache) GetOwnerReferences(key types.UID) []metav1.OwnerReference
GetOwnerReferences retrieves a pod's cached owner references
func (*PodCache) GetPodsInNamespace ¶
GetPodsInNamespace returns a list of pod UIDs given a namespace
type ServiceCache ¶
type ServiceCache struct {
// contains filtered or unexported fields
}
ServiceCache is used for holding values we care about from a pod for quicker lookup than querying the API for them each time.
func NewServiceCache ¶
func NewServiceCache() *ServiceCache
NewServiceCache creates a new minimal pod cache
func (*ServiceCache) AddService ¶
func (sc *ServiceCache) AddService(svc *v1.Service) bool
AddService adds or updates a service in cache This function should only be called after sc.IsCached to prevent unneccesary updates to the internal cache. Returns true if the service is added, false if it was ignored
func (*ServiceCache) Delete ¶
func (sc *ServiceCache) Delete(svc *v1.Service)
Delete removes a service from the cache
func (*ServiceCache) DeleteByKey ¶
func (sc *ServiceCache) DeleteByKey(svcUID types.UID) []types.UID
DeleteByKey removes a service from the cache given a UID Returns pods that were previously matched by this service so their properties may be updated accordingly
func (*ServiceCache) GetMatchingServices ¶
func (sc *ServiceCache) GetMatchingServices(cachedPod *CachedPod) []string
GetMatchingServices returns a list of service names that match the given pod, given the services are in the cache already