skop

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) *bool

func ContextWithLogger

func ContextWithLogger(ctx context.Context, logger log.Logger) context.Context

func Float32

func Float32(f float32) *float32

func Float64

func Float64(f float64) *float64

func Int

func Int(i int) *int

func Int32

func Int32(i int32) *int32

func Int64

func Int64(i int64) *int64

func Logger

func Logger(ctx context.Context) log.Logger

func String

func String(s string) *string

func Uint

func Uint(u uint) *uint

func Uint32

func Uint32(u uint32) *uint32

func Uint64

func Uint64(u uint64) *uint64

Types

type Operator

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

func New

func New(options ...Option) *Operator

New constructs a new operator with the provided options.

func (*Operator) Clientset

func (op *Operator) Clientset() *kubernetes.Clientset

func (*Operator) Config

func (op *Operator) Config() *rest.Config

func (*Operator) Reconcile

func (op *Operator) Reconcile()

Reconcile reconciles all currently known resources.

func (*Operator) Run

func (op *Operator) Run() error

func (*Operator) Stop

func (op *Operator) Stop()

func (*Operator) UpdateStatus

func (op *Operator) UpdateStatus(ctx context.Context, res Resource) error

type Option

type Option func(op *Operator)

func WithConfig

func WithConfig(c *rest.Config) Option

WithConfig configures an operator to use the specified config for creating Kubernetes clients.

func WithDefaultResync added in v2.1.0

func WithDefaultResync(t time.Duration) Option

WithDefaultResync configures an operator to resync after timeout is reached. By default or when an a timeout of 0 is set, the operator does not resync.

func WithLogger

func WithLogger(logger log.Logger) Option

WithLogger configures an operator to use the specified logger. This option is optional and defaults to using the standard library's log package.

func WithNamespace

func WithNamespace(namespace string) Option

WithNamespace configures an operator to only watch for resources in the specified namespace. By default, or when an empty namespace is specified, the operator watches for resources in all namespaces.

func WithReconciler

func WithReconciler(r Reconciler) Option

WithReconciler configures the operator to use the specified reconciler. As an operator can only have one reconciler, when specifying this option multiple times, the last option wins.

func WithResource

func WithResource(group, version, resource string, prototype Resource) Option

WithResource tells an operator the API group, version, and resource name (plural) and also specifies a prototype of the Go struct which represents the custom resource.

type Reconciler

type Reconciler interface {
	Reconcile(ctx context.Context, op *Operator, res Resource) error
}

type ReconcilerFunc

type ReconcilerFunc func(ctx context.Context, op *Operator, res Resource) error

func (ReconcilerFunc) Reconcile

func (f ReconcilerFunc) Reconcile(ctx context.Context, op *Operator, res Resource) error

type Resource

type Resource interface {
	metav1.Object
}

Jump to

Keyboard shortcuts

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