controllercontext

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStoreNotRegistered = errors.New("store not registered")
)

Functions

This section is empty.

Types

type ActiveJobStore

type ActiveJobStore interface {
	CountActiveJobsForConfig(rjc *execution.JobConfig) int64
	CheckAndAdd(rj *execution.Job, oldCount int64) (success bool)
	Delete(rj *execution.Job)
}

type Clientsets

type Clientsets interface {
	Kubernetes() kubernetes.Interface
	Furiko() furiko.Interface
}

func SetUpClientsets

func SetUpClientsets(cfg *rest.Config) (Clientsets, error)

type Configs

type Configs interface {
	Start(ctx context.Context) error
	AllConfigs() (map[configv1.ConfigName]runtime.Object, error)
	JobController() (*configv1.JobControllerConfig, error)
	CronController() (*configv1.CronControllerConfig, error)
}

func SetUpConfigManager

func SetUpConfigManager(cfg *configv1.BootstrapConfigSpec, client kubernetes.Interface) Configs

SetUpConfigManager sets up the ConfigManager and returns a composed Configs interface.

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context is a shared controller context that can be safely shared between controllers.

func NewForConfig

func NewForConfig(cfg *rest.Config, ctrlConfig *configv1.BootstrapConfigSpec) (*Context, error)

NewForConfig prepares a new Context from a kubeconfig and controller manager config spec.

func (*Context) Clientsets

func (c *Context) Clientsets() Clientsets

func (*Context) Configs

func (c *Context) Configs() Configs

Configs returns the dynamic controller configurations.

func (*Context) Informers

func (c *Context) Informers() Informers

func (*Context) Start

func (c *Context) Start(ctx context.Context) error

func (*Context) Stores

func (c *Context) Stores() Stores

Stores returns shared in-memory stores, and is used for dependency injection.

type ContextConfigs

type ContextConfigs struct {
	*configloader.ConfigManager
}

func NewContextConfigs

func NewContextConfigs(mgr *configloader.ConfigManager) *ContextConfigs

func (*ContextConfigs) AllConfigs

func (c *ContextConfigs) AllConfigs() (map[configv1.ConfigName]runtime.Object, error)

AllConfigs returns a map of all configs.

func (*ContextConfigs) CronController

func (c *ContextConfigs) CronController() (*configv1.CronControllerConfig, error)

CronController returns the cron controller configuration.

func (*ContextConfigs) JobController

func (c *ContextConfigs) JobController() (*configv1.JobControllerConfig, error)

JobController returns the job controller configuration.

type ContextInterface

type ContextInterface interface {
	Start(ctx context.Context) error
	Clientsets() Clientsets
	Configs() Configs
	Stores() Stores
	Informers() Informers
}

type ContextStores

type ContextStores struct {
	// contains filtered or unexported fields
}

func NewContextStores

func NewContextStores() *ContextStores

func (*ContextStores) ActiveJobStore

func (c *ContextStores) ActiveJobStore() (ActiveJobStore, error)

ActiveJobStore returns the active job store.

func (*ContextStores) Register

func (c *ContextStores) Register(store Store)

Register a new Store.

type Informers

type Informers interface {
	Start(ctx context.Context) error
	Kubernetes() kubernetes.SharedInformerFactory
	Furiko() furiko.SharedInformerFactory
}

func SetUpInformers

func SetUpInformers(clientsets Clientsets, cfg *configv1.BootstrapConfigSpec) Informers

type Store

type Store interface {
	Name() string
}

type Stores

type Stores interface {
	Register(store Store)
	ActiveJobStore() (ActiveJobStore, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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