scheduler

package
v0.0.0-...-5fcec6e Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClusterResourceIDHashToScheduleWithinPercent

func ClusterResourceIDHashToScheduleWithinPercent(resourceID string) float64

Take a cluster resource ID and deterministically turn it into a % to be used for placing the cluster in the "scheduleAcross". For example, 0.0 will mean that it will be scheduled exactly at the schedule time, 1.0 will mean scheduled at schedule time + scheduleAcross.

func IsValid

func IsValid(t time.Time, sched calendar) bool

func NewService

func NewService(env env.Interface, log *logrus.Entry, dbg schedulerDBs, m metrics.Emitter) *service

func Next

func Next(now time.Time, sched calendar) (time.Time, bool)

func ParseCalendar

func ParseCalendar(s string) (cal calendar, reterr error)

func PercentWithinPeriod

func PercentWithinPeriod(percent float64, scheduleWithin time.Duration) time.Duration

Given a period and a float from 0.0-1.0, calculate the target time within that duration rounded to the second.

func ToSelectorData

func ToSelectorData(doc *api.OpenShiftClusterDocument, subscriptionState string) (selectorData, error)

Types

type Runnable

type Runnable interface {
	Run(context.Context, <-chan struct{}, chan<- struct{}) error
}

type Scheduler

type Scheduler interface {
	Process(context.Context) (bool, error)
	AddMaintenanceTasks(map[api.MIMOTaskID]tasks.MaintenanceTask)
}

func NewSchedulerForSchedule

func NewSchedulerForSchedule(
	_env env.Interface,
	log *logrus.Entry,
	m metrics.Emitter,
	cachedDoc getCachedScheduleDocFunc,
	getClusters getClustersFunc,
	dbs schedulerDBs,
) (Scheduler, error)

type SelectorDataKey

type SelectorDataKey string
const (
	SelectorDataKeyResourceID         SelectorDataKey = "resourceID"
	SelectorDataKeyBucketID           SelectorDataKey = "bucketID"
	SelectorDataKeySubscriptionID     SelectorDataKey = "subscriptionID"
	SelectorDataKeySubscriptionState  SelectorDataKey = "subscriptionState"
	SelectorDataKeyAuthenticationType SelectorDataKey = "authenticationType"
	SelectorDataArchitectureVersion   SelectorDataKey = "architectureVersion"
	SelectorDataProvisioningState     SelectorDataKey = "provisioningState"
	SelectorDataOutboundType          SelectorDataKey = "outboundType"
	SelectorDataAPIServerVisibility   SelectorDataKey = "APIServerVisibility"
	SelectorDataIsManagedDomain       SelectorDataKey = "isManagedDomain"
)

type SelectorDataType

type SelectorDataType string
const (
	SelectorDataTypeString SelectorDataType = "string"
	SelectorDataTypeDate   SelectorDataType = "date"
)

Jump to

Keyboard shortcuts

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