package nodeaffinity
import "k8s.io/component-helpers/scheduling/corev1/nodeaffinity"
Index ¶
- type LazyErrorNodeSelector
- func NewLazyErrorNodeSelector(ns *v1.NodeSelector, opts ...ParseOption) *LazyErrorNodeSelector
- func (ns *LazyErrorNodeSelector) Match(node *v1.Node) (bool, error)
- type NodeSelector
- func NewNodeSelector(ns *v1.NodeSelector, opts ...ParseOption) (*NodeSelector, error)
- func (ns *NodeSelector) Match(node *v1.Node) bool
- type ParseOption
- type PreferredSchedulingTerms
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, opts ...ParseOption) *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, opts ...ParseOption) (*NodeSelector, error)
NewNodeSelector returns a NodeSelector or aggregate 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 ParseOption ¶
type ParseOption func(*parseOptions)
ParseOption is an option for parsing.
func WithPath ¶
func WithPath(p *field.Path) ParseOption
WithPath sets a field.Path to be used as root for parse errors.
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, opts ...ParseOption) (*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.
Source Files ¶
nodeaffinity.go
- Version
- v0.21.0-alpha.1
- Published
- Jan 13, 2021
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 53 minutes ago –
Tools for package owners.