kubernetesk8s.io/kubernetes/pkg/dns/config Index | Files

package config

import "k8s.io/kubernetes/pkg/dns/config"

Index

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`.

Source Files

config.go mocksync.go nopsync.go sync.go

Version
v1.5.6
Published
Mar 28, 2017
Platform
windows/amd64
Imports
11 packages
Last checked
28 seconds ago

Tools for package owners.