config

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// FakeResyncInterval is the interval between resyncs during unit tests
	FakeResyncInterval = time.Duration(time.Second)

	// Labels used to filter objets during unit tests runs
	Labels = map[string]string{"foo": "bar", "spam": "egg"}
)

Functions

func FakeClientSet

func FakeClientSet() *fake.Clientset

FakeClientSet provides a fake.NewSimpleClientset, useful for testing without a real cluster

Types

type KnpConfig

type KnpConfig struct {
	// When DryRun is true, we display but don't really send notifications
	DryRun bool

	// Logger should be used to send all logs
	Logger *logrus.Logger

	// ClientSet represents a connection to a Kubernetes cluster
	ClientSet kubernetes.Interface

	// HealthPort is the facultative healthcheck port
	HealthPort int

	// ResyncIntv define the duration between full resync. Set to 0 to disable resyncs.
	ResyncIntv time.Duration

	// Cluster is the name of the cluster we'll operate on. Mandatory.
	Cluster string

	// Zone is the cluster's zone. Can be guessed if not provided.
	Zone string

	// Project is the cluster's project. Can be guessed from host's metadata if not provided.
	Project string
}

KnpConfig is the configuration struct, passed to controllers's Init()

func FakeConfig

func FakeConfig(objects ...runtime.Object) *KnpConfig

FakeConfig returns a configuration struct using a fake clientset, for unit tests

func (*KnpConfig) Init

func (c *KnpConfig) Init(apiserver string, kubeconfig string) error

Init initialize the configuration's ClientSet

Jump to

Keyboard shortcuts

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