nodeaffinity

package
v1.5.0-alpha.0 Latest Latest
Warning

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

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

README

This package is copied from https://github.com/kubernetes/component-helpers/tree/master/scheduling/corev1/nodeaffinity

Code was part of https://github.com/kubernetes/kubernetes, and was extracted to separate package on v0.20.0 beta.

Operator and cloud providers use only stable releases, so until we migrate Operator and all dependency packages to 0.20 k8s, this have to stay here.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LazyErrorNodeSelector

type LazyErrorNodeSelector struct {
	// contains filtered or unexported fields
}

LazyErrorNodeSelector is a runtime representation of v1.NodeSelector that only reports parse errors when no terms match.

func NewLazyErrorNodeSelector

func NewLazyErrorNodeSelector(ns *v1.NodeSelector) *LazyErrorNodeSelector

NewLazyErrorNodeSelector creates a NodeSelector that only reports parse errors when no terms match.

func (*LazyErrorNodeSelector) Match

func (ns *LazyErrorNodeSelector) Match(node *v1.Node) (bool, error)

Match checks whether the node labels and fields match the selector terms, ORed; nil or empty term matches no objects. Parse errors are only returned if no terms matched.

type NodeSelector

type NodeSelector struct {
	// contains filtered or unexported fields
}

NodeSelector is a runtime representation of v1.NodeSelector.

func NewNodeSelector

func NewNodeSelector(ns *v1.NodeSelector) (*NodeSelector, error)

NewNodeSelector returns a NodeSelector or all parsing errors found.

func (*NodeSelector) Match

func (ns *NodeSelector) Match(node *v1.Node) bool

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

type PreferredSchedulingTerms

type PreferredSchedulingTerms struct {
	// contains filtered or unexported fields
}

PreferredSchedulingTerms is a runtime representation of []v1.PreferredSchedulingTerms.

func NewPreferredSchedulingTerms

func NewPreferredSchedulingTerms(terms []v1.PreferredSchedulingTerm) (*PreferredSchedulingTerms, error)

NewPreferredSchedulingTerms returns a PreferredSchedulingTerms or all the parsing errors found. If a v1.PreferredSchedulingTerm has a 0 weight, its parsing is skipped.

func (*PreferredSchedulingTerms) Score

func (t *PreferredSchedulingTerms) Score(node *v1.Node) int64

Score returns a score for a Node: the sum of the weights of the terms that match the Node.

Jump to

Keyboard shortcuts

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