sleepinfo

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock interface {
	Now() time.Time
}

clock knows how to get the current time. It can be used to fake out timing for testing.

type Resources

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

func NewResources

func NewResources(ctx context.Context, resourceClient resource.ResourceClient, namespace string, sleepInfoData SleepInfoData) (Resources, error)

type SleepInfoData

type SleepInfoData struct {
	LastSchedule                time.Time
	CurrentOperationType        string
	OriginalDeploymentsReplicas map[string]int32
	CurrentOperationSchedule    string
	NextOperationSchedule       string
	OriginalCronJobStatus       map[string]bool
}

func (SleepInfoData) IsSleepOperation

func (s SleepInfoData) IsSleepOperation() bool

func (SleepInfoData) IsWakeUpOperation

func (s SleepInfoData) IsWakeUpOperation() bool

type SleepInfoReconciler

type SleepInfoReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
	Clock
	Metrics    metrics.Metrics
	SleepDelta int64
}

SleepInfoReconciler reconciles a SleepInfo object

func (*SleepInfoReconciler) Reconcile

func (r *SleepInfoReconciler) 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.

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

func (*SleepInfoReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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