config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 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 added in v0.3.0

func FakeClientSet() *fake.Clientset

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

Types

type KdnConfig

type KdnConfig 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

	// Endpoint is the API URL where we'll send notifications
	Endpoint string

	// TokenHdr holds a facultative HTTP header name sent with notifications
	TokenHdr string

	// TokenVal holds a facultative HTTP value send with notifications
	TokenVal string

	// Filter holds a facultative Kubernetes selector
	Filter string

	// HealthPort is the facultative healthcheck port
	HealthPort int

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

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

func FakeConfig added in v0.3.0

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

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

func (*KdnConfig) Init

func (c *KdnConfig) Init(apiserver, context, 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