nodefeaturerule

package
v0.15.5 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchInstances

func MatchInstances(m *nfdv1alpha1.MatchExpressionSet, instances []nfdv1alpha1.InstanceFeature) (bool, error)

MatchInstances evaluates the MatchExpressionSet against a set of instance features, each of which is an individual set of key-value pairs (attributes).

func MatchKeys

func MatchKeys(m *nfdv1alpha1.MatchExpressionSet, keys map[string]nfdv1alpha1.Nil) (bool, error)

MatchKeys evaluates the MatchExpressionSet against a set of keys.

func MatchValues

func MatchValues(m *nfdv1alpha1.MatchExpressionSet, values map[string]string) (bool, error)

MatchValues evaluates the MatchExpressionSet against a set of key-value pairs.

Types

type MatchedElement

type MatchedElement map[string]string

MatchedElement holds one matched Instance.

func MatchGetInstances

func MatchGetInstances(m *nfdv1alpha1.MatchExpressionSet, instances []nfdv1alpha1.InstanceFeature) ([]MatchedElement, error)

MatchGetInstances evaluates the MatchExpressionSet against a set of instance features, each of which is an individual set of key-value pairs (attributes). A slice containing all matching instances is returned. An empty (non-nil) slice is returned if no matching instances were found.

func MatchGetKeys

MatchGetKeys evaluates the MatchExpressionSet against a set of keys and returns all matched keys or nil if no match was found. Note that an empty MatchExpressionSet returns a match with an empty slice of matched features.

func MatchGetValues

func MatchGetValues(m *nfdv1alpha1.MatchExpressionSet, values map[string]string) (bool, []MatchedElement, error)

MatchGetValues evaluates the MatchExpressionSet against a set of key-value pairs and returns all matched key-value pairs. Note that an empty MatchExpressionSet returns a match with an empty slice of matched features.

func MatchInstanceAttributeNames

func MatchInstanceAttributeNames(m *nfdv1alpha1.MatchExpression, instances []nfdv1alpha1.InstanceFeature) ([]MatchedElement, error)

MatchInstanceAttributeNames evaluates the MatchExpression against a set of instance features, matching against the names of their attributes.

func MatchKeyNames

func MatchKeyNames(m *nfdv1alpha1.MatchExpression, keys map[string]nfdv1alpha1.Nil) (bool, []MatchedElement, error)

MatchKeyNames evaluates the MatchExpression against names of a set of key features.

func MatchValueNames

func MatchValueNames(m *nfdv1alpha1.MatchExpression, values map[string]string) (bool, []MatchedElement, error)

MatchValueNames evaluates the MatchExpression against names of a set of value features.

type RuleOutput

type RuleOutput struct {
	ExtendedResources map[string]string
	Labels            map[string]string
	Annotations       map[string]string
	Vars              map[string]string
	Taints            []corev1.Taint
}

RuleOutput contains the output out rule execution. +k8s:deepcopy-gen=false

func Execute

func Execute(r *nfdv1alpha1.Rule, features *nfdv1alpha1.Features) (RuleOutput, error)

Execute the rule against a set of input features.

Jump to

Keyboard shortcuts

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