operator

package
v0.0.0-...-c4c52f5 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultCR is the name of the global cluster-scoped ClusterResourceOverride object that
	// the operator will be watching for.
	// All other ClusterResourceOverride object(s) are ignored since the operand is
	// basically a cluster singleton.
	DefaultCR = "cluster"

	// Default worker count is 1.
	DefaultWorkerCount = 1

	// Default ResyncPeriod for primary (ClusterResourceOverride objects)
	DefaultResyncPeriodPrimaryResource = 1 * time.Hour

	// Default ResyncPeriod for all secondary resources that the operator manages.
	DefaultResyncPeriodSecondaryResource = 15 * time.Hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Name is the name of the operator. This name will be used to create kube resources.
	// More info: http://kubernetes.io/docs/user-guide/identifiers#names.
	Name string

	// Namespace is the namespace where the operator is installed.
	Namespace string

	// ShutdownContext is the parent context.
	ShutdownContext context.Context

	// RestConfig is the rest.Config object to be used to build clients.
	RestConfig *rest.Config

	// OperandImage points to the operand image.
	OperandImage string

	// OperandVersion points to the operand version.
	OperandVersion string
}

func (*Config) String

func (c *Config) String() string

func (*Config) Validate

func (c *Config) Validate() error

type Interface

type Interface interface {
	// Run will start a new operator instance based on the given config
	// Run starts the operator instance and waits indefinitely until the parent
	// shutdown context is done.
	// Run returns on any error encountered during initialization.
	// Any error encountered during initialization is written to the errorCh channel
	// specified so that the caller can take appropriate action.
	Run(config *Config, errorCh chan<- error)

	// Done returns a channel that's closed when the operator is done.
	Done() <-chan struct{}
}

Interface defines an interface for the operator.

func NewRunner

func NewRunner() Interface

Jump to

Keyboard shortcuts

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