This section is empty.


View Source
var ErrWatchChannelClosed = errors.New("watcher channel has closed")

    ErrWatchChannelClosed should restart watcher


    func InjectionConfigsFromConfigMap

    func InjectionConfigsFromConfigMap(cm v1.ConfigMap) ([]*config.InjectionConfig, error)

      InjectionConfigsFromConfigMap parse items in a configmap into a list of InjectionConfigs


      type Config

      type Config struct {
      	Namespace       string
      	ConfigMapLabels map[string]string

        Config is a configuration struct for the Watcher type

        func NewConfig

        func NewConfig() *Config

          NewConfig returns a new initialized Config

          type Event

          type Event uint8

            Event is what happened to the config (add/delete/update)

            const (
            	// EventAdd is a new ConfigMap
            	EventAdd Event = iota
            	// EventUpdate is an Updated ConfigMap
            	// EventDelete is a deleted ConfigMap

            type K8sConfigMapWatcher

            type K8sConfigMapWatcher struct {
            	// contains filtered or unexported fields

              K8sConfigMapWatcher is a struct that connects to the API and collects, parses, and emits sidecar configurations

              func New

              func New(cfg Config) (*K8sConfigMapWatcher, error)

                New creates a new K8sConfigMapWatcher

                func (*K8sConfigMapWatcher) Get

                func (c *K8sConfigMapWatcher) Get() (cfgs []*config.InjectionConfig, err error)

                  Get fetches all matching ConfigMaps

                  func (*K8sConfigMapWatcher) Watch

                  func (c *K8sConfigMapWatcher) Watch(notifyMe chan<- interface{}, stopCh <-chan struct{}) error

                    Watch watches for events impacting watched ConfigMaps and emits their events across a channel

                    type Message

                    type Message struct {
                    	Event           Event
                    	InjectionConfig config.InjectionConfig

                      Message is a message that describes a change and payload to a sidecar configuration