config

package
v1.5.5-beta.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// The inclusion of TypeMeta is to ensure future compatibility if the
	// Config object was populated directly via a Kubernetes API mechanism.
	//
	// For example, instead of the custom implementation here, the
	// configuration could be obtained from an API that unifies
	// command-line flags, config-map, etc mechanisms.
	types.TypeMeta

	// Map of federation names that the cluster in which this kube-dns
	// is running belongs to, to the corresponding domain names.
	Federations map[string]string `json:"federations"`
}

Config populated either from the configuration source (command line flags or via the config map mechanism).

func NewDefaultConfig

func NewDefaultConfig() *Config

func (*Config) Validate

func (config *Config) Validate() error

IsValid returns whether or not the configuration is valid.

type MockSync

type MockSync struct {
	// Config that will be returned from Once().
	Config *Config
	// Error that will be returned from Once().
	Error error

	// Chan to send new configurations on.
	Chan chan *Config
}

MockSync is a testing mock.

func NewMockSync

func NewMockSync(config *Config, error error) *MockSync

func (*MockSync) Once

func (sync *MockSync) Once() (*Config, error)

func (*MockSync) Periodic

func (sync *MockSync) Periodic() <-chan *Config

type Sync

type Sync interface {
	// Once does a blocking synchronization of the config map. If the
	// ConfigMap fails to validate, this method will return nil, err.
	Once() (*Config, error)

	// Start a periodic synchronization of the configuration map. When a
	// successful configuration map update is detected, the
	// configuration will be sent to the channel.
	//
	// It is an error to call this more than once.
	Periodic() <-chan *Config
}

Sync manages synchronization of the config map.

func NewNopSync

func NewNopSync(config *Config) Sync

func NewSync

func NewSync(client clientset.Interface, ns string, name string) Sync

NewSync for ConfigMap from namespace `ns` and `name`.

Jump to

Keyboard shortcuts

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