Help us shape the future of Go! Take the 2026 Go Developer Survey

controller

package
v2.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: Apache-2.0 Imports: 9 Imported by: 590

Documentation

Overview

Package controller configures controller options.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeLogOptions

type ChangeLogOptions struct {
	ChangeLogger managed.ChangeLogger
}

ChangeLogOptions for recording changes to managed resources into the change logs.

type ESSOptions

type ESSOptions struct {
	TLSConfig     *tls.Config
	TLSSecretName *string
}

ESSOptions for External Secret Stores.

type Gate

type Gate interface {
	// Register to call a callback function when all given GVKs are marked true. If the callback is unblocked, the
	// registration is removed.
	Register(callback func(), gvks ...schema.GroupVersionKind)
	// Set marks the associated condition to the given value. If the condition is already set as
	// that value, then this is a no-op. Returns true if there was an update detected.
	Set(gvk schema.GroupVersionKind, ready bool) bool
}

A Gate is an interface to allow reconcilers to delay a callback until a set of GVKs are set to true inside the gate.

type MetricOptions

type MetricOptions struct {
	// PollStateMetricInterval at which each controller should record state
	PollStateMetricInterval time.Duration

	// MetricsRecorder to use for recording metrics.
	MRMetrics managed.MetricRecorder

	// MRStateMetrics to use for recording state metrics.
	MRStateMetrics *statemetrics.MRStateMetrics
}

MetricOptions for recording metrics.

type Options

type Options struct {
	// The Logger controllers should use.
	Logger logging.Logger

	// The GlobalRateLimiter used by this controller manager. The rate of
	// reconciles across all controllers will be subject to this limit.
	GlobalRateLimiter ratelimiter.RateLimiter

	// PollInterval at which each controller should speculatively poll to
	// determine whether it has work to do.
	PollInterval time.Duration

	// MaxConcurrentReconciles for each controller.
	MaxConcurrentReconciles int

	// Features that should be enabled.
	Features *feature.Flags

	// ESSOptions for External Secret Stores.
	ESSOptions *ESSOptions

	// MetricOptions for recording metrics.
	MetricOptions *MetricOptions

	// ChangeLogOptions for recording change logs.
	ChangeLogOptions *ChangeLogOptions

	// Gate implements a gated function callback pattern.
	Gate Gate
}

Options frequently used by most Crossplane controllers.

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns a functional set of options with conservative defaults.

func (Options) ForControllerRuntime

func (o Options) ForControllerRuntime() controller.Options

ForControllerRuntime extracts options for controller-runtime.

Jump to

Keyboard shortcuts

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