package migration

import "k8s.io/kubernetes/pkg/scheduler/framework/plugins/migration"

Index

Constants

const (
	// PredicatesStateKey is the key in CycleState to PredicateStateData
	PredicatesStateKey = "predicates"

	// PrioritiesStateKey is the key in CycleState to PrioritiesStateData
	PrioritiesStateKey = "priorities"
)

Functions

func ErrorToFrameworkStatus

func ErrorToFrameworkStatus(err error) *framework.Status

ErrorToFrameworkStatus converts an error to a framework status.

func PredicateMetadata

func PredicateMetadata(state *framework.CycleState) interface{}

PredicateMetadata returns predicate metadata stored in CycleState.

func PredicateResultToFrameworkStatus

func PredicateResultToFrameworkStatus(reasons []predicates.PredicateFailureReason, err error) *framework.Status

PredicateResultToFrameworkStatus converts a predicate result (PredicateFailureReason + error) to a framework status.

func PriorityMetadata

func PriorityMetadata(state *framework.CycleState) interface{}

PriorityMetadata returns priority metadata stored in CycleState.

Types

type PredicatesStateData

type PredicatesStateData struct {
	Reference interface{}
}

PredicatesStateData is a pointer to Metadata. In the normal case, StateData is supposed to be generated and stored in CycleState by a framework plugin (like a PreFilter pre-computing data for its corresponding Filter). However, during migration, the scheduler will inject a pointer to Metadata into CycleState. This "hack" is necessary because during migration Filters that implement predicates functionality will be calling into the existing predicate functions, and need to pass Metadata.

func (*PredicatesStateData) Clone

Clone is supposed to make a copy of the data, but since this is just a pointer, we are practically just copying the pointer. This is ok because the actual reference to the Metadata copy that is made by generic_scheduler during preemption cycle will be injected again outside the framework.

type PrioritiesStateData

type PrioritiesStateData struct {
	Reference interface{}
}

PrioritiesStateData is a pointer to PrioritiesMetadata.

func (*PrioritiesStateData) Clone

Clone is supposed to make a copy of the data, but since this is just a pointer, we are practically just copying the pointer.

Source Files

utils.go

Version
v1.17.17
Published
Jan 13, 2021
Platform
js/wasm
Imports
3 packages
Last checked
57 seconds ago

Tools for package owners.