options

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package options provides functional options for controller runtime.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedResource

type CachedResource struct {
	Namespace resource.Namespace
	Type      resource.Type
}

CachedResource is a resource that should be cached by controller runtime.

type Option

type Option func(*Options)

Option is a functional option for controller runtime.

func WithCachedResource

func WithCachedResource(namespace resource.Namespace, typ resource.Type) Option

WithCachedResource adds a resource to the list of resources that should be cached by controller runtime.

func WithChangeRateLimit

func WithChangeRateLimit(limit rate.Limit, burst int) Option

WithChangeRateLimit sets rate limit for changes performed by controllers.

This might be used to rate limit ill-behaving controllers from overloading the system with changes.

func WithMetrics

func WithMetrics(enabled bool) Option

WithMetrics enables runtime metrics to be exposed via metrics package.

func WithWarnOnUncachedReads

func WithWarnOnUncachedReads(warn bool) Option

WithWarnOnUncachedReads adds a warning log when a controller reads an uncached resource.

type Options

type Options struct {
	// CachedResources is a list of resources that should be cached by controller runtime.
	CachedResources []CachedResource
	// ChangeRateLimit and ChangeBurst configure rate limiting of changes performed by controllers.
	ChangeRateLimit rate.Limit
	ChangeBurst     int
	// MetricsEnabled enables runtime metrics to be exposed via metrics package.
	MetricsEnabled bool
	// WarnOnUncachedReads adds a warning log when a controller reads an uncached resource.
	WarnOnUncachedReads bool
}

Options configures controller runtime.

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns default value of Options.

Jump to

Keyboard shortcuts

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