helper

package
v0.0.0-...-d4c82a0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultNormalizeScore

func DefaultNormalizeScore(maxPriority int64, reverse bool, scores framework.NodeScoreList) *framework.Status

DefaultNormalizeScore generates a Normalize Score function that can normalize the scores to [0, maxPriority]. If reverse is set to true, it reverses the scores by subtracting it from maxPriority.

func FindMatchingUntoleratedTaint

func FindMatchingUntoleratedTaint(taints []v1.Taint, tolerations []v1.Toleration, inclusionFilter taintsFilterFunc) (v1.Taint, bool)

func MatchNodeSelectorTerms

func MatchNodeSelectorTerms(
	nodeSelectorTerms []v1.NodeSelectorTerm,
	nodeLabels labels.Set,
	nodeFields fields.Set,
) bool

MatchNodeSelectorTerms checks whether the node labels and fields match node selector terms in ORed; nil or empty term matches no objects.

func NodeSelectorRequirementsAsFieldSelector

func NodeSelectorRequirementsAsFieldSelector(nsm []v1.NodeSelectorRequirement) (fields.Selector, error)

NodeSelectorRequirementsAsFieldSelector converts the []NodeSelectorRequirement core type into a struct that implements fields.Selector.

func NodeSelectorRequirementsAsSelector

func NodeSelectorRequirementsAsSelector(nsm []v1.NodeSelectorRequirement) (labels.Selector, error)

NodeSelectorRequirementsAsSelector converts the []NodeSelectorRequirement api type into a struct that implements labels.Selector.

func PodMatchesNodeSelectorAndAffinityTerms

func PodMatchesNodeSelectorAndAffinityTerms(pod *v1.Pod, node *v1.Node) bool

PodMatchesNodeSelectorAndAffinityTerms checks whether the pod is schedulable onto nodes according to the requirements in both NodeAffinity and nodeSelector.

func TolerationsTolerateTaint

func TolerationsTolerateTaint(tolerations []v1.Toleration, taint *v1.Taint) bool

TolerationsTolerateTaint checks if taint is tolerated by any of the tolerations.

Types

This section is empty.

Jump to

Keyboard shortcuts

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