configmap

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package configmap exists to facilitate consuming Kubernetes ConfigMap resources in various ways, including:

  • Watching them for changes over time, and
  • Loading them from a VolumeMount.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(p string) (map[string]string, error)

Load reads the "Data" of a ConfigMap from a particular VolumeMount.

Types

type Observer

type Observer func(*corev1.ConfigMap)

Observer is the signature of the callbacks that notify an observer of the latest state of a particular configuration. An observer should not modify the provided ConfigMap, and should `.DeepCopy()` it for persistence (or otherwise process its contents).

type Watcher

type Watcher interface {
	// Watch is called to register a callback to be notified when a named ConfigMap changes.
	Watch(string, Observer)

	// Start is called to initiate the watches and provide a channel to signal when we should
	// stop watching.  When Start returns, all registered Observers will be called with the
	// initial state of the ConfigMaps they are watching.
	Start(<-chan struct{}) error
}

Watcher defined the interface that a configmap implementation must implement.

func NewDefaultWatcher

func NewDefaultWatcher(kc kubernetes.Interface, ns string) Watcher

NewDefaultWatcher creates a new default configmap.Watcher instance.

func NewFixedWatcher

func NewFixedWatcher(cms ...*corev1.ConfigMap) Watcher

NewFixedWatcher returns an Watcher that exposes the fixed collection of ConfigMaps.

Jump to

Keyboard shortcuts

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