informer

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterConfigByLabelExists

func FilterConfigByLabelExists(labelKey string) (*labels.Requirement, error)

FilterConfigByLabelExists returns an "exists" label requirement for the given label key.

Types

type InformedWatcher

type InformedWatcher struct {

	// Embedding this struct allows us to reuse the logic
	// of registering and notifying observers. This simplifies the
	// InformedWatcher to just setting up the Kubernetes informer.
	configmap.ManualWatcher
	// contains filtered or unexported fields
}

InformedWatcher provides an informer-based implementation of Watcher.

func NewInformedWatcher

func NewInformedWatcher(kc kubernetes.Interface, namespace string, lr ...labels.Requirement) *InformedWatcher

NewInformedWatcher watches a Kubernetes namespace for ConfigMap changes. Optional label requirements allow restricting the list of ConfigMap objects that is tracked by the underlying Informer.

func NewInformedWatcherFromFactory

func NewInformedWatcherFromFactory(sif informers.SharedInformerFactory, namespace string) *InformedWatcher

NewInformedWatcherFromFactory watches a Kubernetes namespace for ConfigMap changes.

func (*InformedWatcher) Start

func (i *InformedWatcher) Start(stopCh <-chan struct{}) error

Start implements Watcher. Start will wait for all watched resources to exist and for the add event handler to be invoked at least once for each before continuing or for the stopCh to be signalled, whichever happens first. If the watched resource is defaulted, Start will invoke the add event handler directly and will not wait for a further add event from the API server.

func (*InformedWatcher) WatchWithDefault

func (i *InformedWatcher) WatchWithDefault(cm corev1.ConfigMap, o ...configmap.Observer)

WatchWithDefault implements DefaultingWatcher. Adding a default for the configMap being watched means that when Start is called, Start will not wait for the add event from the API server.

Jump to

Keyboard shortcuts

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