controllerbase

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveFinalizer

func RemoveFinalizer(metaObj *metav1.ObjectMeta, finalizer string)

func ShouldRetry

func ShouldRetry(err error) bool

func WithReconciliationId added in v0.14.0

func WithReconciliationId(ctx context.Context) zap.Field

func WrapRetryError

func WrapRetryError(err error) error

Types

type Controller

type Controller struct {
	Base ControllerBase
	// contains filtered or unexported fields
}

func NewController

func NewController(base ControllerBase, coreClient kubernetes.Interface) *Controller

func (*Controller) EventRecorder

func (c *Controller) EventRecorder() record.EventRecorder

func (*Controller) Log

func (c *Controller) Log(ctx context.Context) *zap.Logger

func (*Controller) OnAdd

func (c *Controller) OnAdd(obj interface{})

func (*Controller) OnDelete

func (c *Controller) OnDelete(obj interface{})

func (*Controller) OnUpdate

func (c *Controller) OnUpdate(old, new interface{})

func (*Controller) ProcessKey

func (c *Controller) ProcessKey(key string) error

func (*Controller) Run

func (c *Controller) Run(ctx context.Context, workers int)

func (*Controller) Shutdown added in v0.14.0

func (c *Controller) Shutdown()

type ControllerBase

type ControllerBase interface {
	Name() string
	Finalizers() []string
	ListerSynced() []cache.InformerSynced
	EventSources() []cache.SharedIndexInformer
	ConvertToKeys() ObjectToKeyConverter
	GetObject(key string) (interface{}, error)
	UpdateObject(ctx context.Context, obj interface{}) error
	Reconcile(ctx context.Context, obj interface{}) error
	Finalize(ctx context.Context, obj interface{}) error
}

type ObjectToKeyConverter

type ObjectToKeyConverter func(obj interface{}) (keys []string, err error)

type ReconciliationId added in v0.14.0

type ReconciliationId struct{}

type RetryError

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

func (*RetryError) Error

func (e *RetryError) Error() string

func (*RetryError) Is

func (e *RetryError) Is(err error) bool

func (*RetryError) Unwrap

func (e *RetryError) Unwrap() error

type TimeKey

type TimeKey struct{}

Jump to

Keyboard shortcuts

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