configmap

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2018 License: Apache-2.0 Imports: 13 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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