controllers

package
v0.0.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CTX_VALUE_KEY

type CTX_VALUE_KEY string
var (
	CTX_VALUE_NAME      CTX_VALUE_KEY = "name"
	CTX_VALUE_NAMESPACE CTX_VALUE_KEY = "namespace"
)

type Cron

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

func NewCron

func NewCron() *Cron

func (*Cron) Add

func (c *Cron) Add(namespacedName types.NamespacedName, cronItems []CronItem) error

func (*Cron) Clear

func (c *Cron) Clear(namespacedName types.NamespacedName)

func (*Cron) Start

func (c *Cron) Start()

func (*Cron) Stop

func (c *Cron) Stop()

type CronContext

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

func NewCronContext

func NewCronContext(
	reconciler *LendingConfigReconciler,
	lendingConfig *LendingConfig,
	event LendingEvent,
) *CronContext

func (*CronContext) Run

func (cronctx *CronContext) Run()

type CronItem

type CronItem struct {
	Cron string
	Job  cron.Job
}

type GlobalCronContext added in v0.0.3

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

type LendingConfig

func (*LendingConfig) ActivateTargetResources added in v0.0.4

func (config *LendingConfig) ActivateTargetResources(ctx context.Context, reconciler *LendingConfigReconciler) error

func (*LendingConfig) ClearSchedules

func (config *LendingConfig) ClearSchedules(ctx context.Context, reconciler *LendingConfigReconciler) error

func (*LendingConfig) DeactivateTargetResources added in v0.0.4

func (config *LendingConfig) DeactivateTargetResources(ctx context.Context, reconciler *LendingConfigReconciler) ([]v1alpha1.LendingReference, error)

func (*LendingConfig) ToCompatible

func (*LendingConfig) ToNamespacedName

func (config *LendingConfig) ToNamespacedName() types.NamespacedName

func (*LendingConfig) UpdateSchedules

func (config *LendingConfig) UpdateSchedules(ctx context.Context, reconciler *LendingConfigReconciler) error

type LendingConfigEvent

type LendingConfigEvent = string
const (
	SchedulesUpdated LendingConfigEvent = "SchedulesUpdated"
	SchedulesCleared LendingConfigEvent = "SchedulesCleared"
	LendingStarted   LendingConfigEvent = "LendingStarted"
	LendingEnded     LendingConfigEvent = "endingEnded"
)

type LendingConfigReconciler

type LendingConfigReconciler struct {
	client.Client
	Recorder record.EventRecorder
	Cron     *Cron
}

LendingConfigReconciler reconciles a LendingConfig object

func (*LendingConfigReconciler) Reconcile

func (r *LendingConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the LendingConfig object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.11.0/pkg/reconcile

func (*LendingConfigReconciler) SetupWithManager

func (r *LendingConfigReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type LendingEvent

type LendingEvent string
const (
	LendingStart LendingEvent = "LendingStart"
	LendingEnd   LendingEvent = "LendingEnd"
)

Jump to

Keyboard shortcuts

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