algorithm

package
v0.0.0-...-4d19ac6 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScheduleOneSlice

func ScheduleOneSlice(slice *SliceInfo, snapshot *internalcache.NamespaceSchedSnapshot) (string, error)

ScheduleOneSlice checks snapshot and returns cluster than that fits the slice

func SchedulePod

func SchedulePod(pod *internalcache.Pod, snapshot *internalcache.PodSchedSnapshot) (string, error)

SchedulePod checks snapshot and returns cluster name that fits the pod

Types

type SliceInfo

type SliceInfo struct {
	Namespace string // namespace key
	Request   corev1.ResourceList
	Mandatory string // if not empty, it is the cluster that the slice should go if all checks are passed
	Hint      string // if not empty, it is the preferred cluster

	Result string // scheduled cluster name
	Err    error
}

SliceInfo is the input to the algorithm.

type SliceInfoArray

type SliceInfoArray []*SliceInfo

SliceInfoArray is the list of SliceInfo.

func ScheduleNamespaceSlices

func ScheduleNamespaceSlices(slices SliceInfoArray, snapshot *internalcache.NamespaceSchedSnapshot) SliceInfoArray

ScheduleNamespaceSlices applies ScheduleOneSlice for each slice

func (*SliceInfoArray) Repeat

func (s *SliceInfoArray) Repeat(n int, namespace string, request corev1.ResourceList, mandatory, hint string)

Repeat adds the request to SliceInfoArray one more time.

Jump to

Keyboard shortcuts

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