migration

package
v1.17.17 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

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

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

Variables

This section is empty.

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.

Jump to

Keyboard shortcuts

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