config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2014 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Examples

Constants

View Source
const (
	OverwriteExistingDstKey     = 1 << iota
	ErrorOnExistingDstKey       = 1 << iota
	ErrorOnDifferentDstKeyValue = 1 << iota
)

mergeMaps flags

Variables

This section is empty.

Functions

func AddConfigLabels

func AddConfigLabels(c *api.Config, labels labels.Set) error

AddConfigLabels adds new label(s) to all resources defined in the given Config.

Types

type ApplyResult

type ApplyResult struct {
	Error   error
	Message string
}

func Apply

func Apply(namespace string, data []byte, storage clientapi.ClientMappings) (result []ApplyResult, err error)

Apply creates and manages resources defined in the Config. The create process wont stop on error, but it will finish the job and then return error and for each item in the config a error and status message string.

Example
kubeClient, _ := kclient.New(&kclient.Config{Host: "127.0.0.1"})
testClientMappings := clientapi.ClientMappings{
	"pods":     {"Pod", kubeClient.RESTClient, klatest.Codec},
	"services": {"Service", kubeClient.RESTClient, klatest.Codec},
}
data, _ := ioutil.ReadFile("config_test.json")
Apply(kapi.NamespaceDefault, data, testClientMappings)
Output:

Directories

Path Synopsis
api
Package api defines and registers types for Config objects.
Package api defines and registers types for Config objects.

Jump to

Keyboard shortcuts

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