manager

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package manager implements the controller manager for all controllers in Railgun.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Release returns the release version
	// NOTE: the value of this is set at compile time using the -X flag for go tool link.
	//       See: "go doc cmd/link" for details, and "../Dockerfile.railgun" for invocation via "go build".
	Release = "UNKNOWN"

	// Repo returns the git repository URL
	// NOTE: the value of this is set at compile time using the -X flag for go tool link.
	//       See: "go doc cmd/link" for details, and "../Dockerfile.railgun" for invocation via "go build".
	Repo = "UNKNOWN"

	// Commit returns the short sha from git
	// NOTE: the value of this is set at compile time using the -X flag for go tool link.
	//       See: "go doc cmd/link" for details, and "../Dockerfile.railgun" for invocation via "go build".
	Commit = "UNKNOWN"
)

Functions

func Run

func Run(ctx context.Context, c *config.Config) error

Run starts the controller manager and blocks until it exits.

Types

type AutoHandler

type AutoHandler func(client.Reader) bool

AutoHandler decides whether the specific controller shall be enabled (true) or disabled (false).

type Controller

type Controller interface {
	SetupWithManager(ctrl.Manager) error
}

Controller is a Kubernetes controller that can be plugged into Manager.

type ControllerDef

type ControllerDef struct {
	IsEnabled   *util.EnablementStatus
	AutoHandler AutoHandler
	Controller  Controller
}

ControllerDef is a specification of a Controller that can be conditionally registered with Manager.

func (*ControllerDef) MaybeSetupWithManager

func (c *ControllerDef) MaybeSetupWithManager(mgr ctrl.Manager) error

MaybeSetupWithManager runs SetupWithManager on the controller if its EnablementStatus is either "enabled", or "auto" and AutoHandler says that it should be enabled.

func (*ControllerDef) Name

func (c *ControllerDef) Name() string

Name returns a human-readable name of the controller.

Jump to

Keyboard shortcuts

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