matcher

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const LabelSelectorValIndex = "spec.nodeOvercommitSelectorVal"

Variables

This section is empty.

Functions

func GetValidNodeOvercommitConfig

func GetValidNodeOvercommitConfig(nocIndexer cache.Indexer, key string) (*v1alpha1.NodeOvercommitConfig, error)

Types

type ConfigToNodes

type ConfigToNodes map[string]sets.String

type DummyMatcher

type DummyMatcher struct{}

func (*DummyMatcher) DelNode

func (dm *DummyMatcher) DelNode(_ string)

func (*DummyMatcher) GetConfig

func (*DummyMatcher) GetNodeToConfig

func (dm *DummyMatcher) GetNodeToConfig(_ string) *v1alpha1.NodeOvercommitConfig

func (*DummyMatcher) GetNodes

func (dm *DummyMatcher) GetNodes(_ string) []string

func (*DummyMatcher) ListNodeToConfig

func (dm *DummyMatcher) ListNodeToConfig() map[string]string

func (*DummyMatcher) MatchConfig

func (dm *DummyMatcher) MatchConfig(_ string) ([]string, error)

func (*DummyMatcher) MatchNode

func (dm *DummyMatcher) MatchNode(_ string) (*v1alpha1.NodeOvercommitConfig, error)

func (*DummyMatcher) Reconcile

func (dm *DummyMatcher) Reconcile() error

type Matcher

type Matcher interface {
	// Reconcile rematch all configs and nodes
	Reconcile() error

	// MatchConfig matches nodes for config, return nodeNames whose matched config maybe updated.
	MatchConfig(configName string) ([]string, error)
	// MatchNode matches and sorts configs for node.
	MatchNode(nodeName string) (*v1alpha1.NodeOvercommitConfig, error)
	// ListNodeToConfig list nodes with matched configName
	ListNodeToConfig() map[string]string
	// GetConfig get matched config by nodeName
	GetConfig(nodeName string) *v1alpha1.NodeOvercommitConfig
	// GetNodes get matched nodes by configName
	GetNodes(configName string) []string
	// DelNode delete node in matcher cache
	DelNode(nodeName string)
}

type MatcherImpl

type MatcherImpl struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*MatcherImpl) DelNode

func (i *MatcherImpl) DelNode(nodeName string)

func (*MatcherImpl) GetConfig

func (i *MatcherImpl) GetConfig(nodeName string) *v1alpha1.NodeOvercommitConfig

func (*MatcherImpl) GetNodes

func (i *MatcherImpl) GetNodes(configName string) []string

func (*MatcherImpl) ListNodeToConfig

func (i *MatcherImpl) ListNodeToConfig() map[string]string

func (*MatcherImpl) MatchConfig

func (i *MatcherImpl) MatchConfig(configName string) ([]string, error)

func (*MatcherImpl) MatchNode

func (i *MatcherImpl) MatchNode(nodeName string) (*v1alpha1.NodeOvercommitConfig, error)

func (*MatcherImpl) Reconcile

func (i *MatcherImpl) Reconcile() error

type NocList

type NocList []*v1alpha1.NodeOvercommitConfig

func (NocList) Len

func (nl NocList) Len() int

func (NocList) Less

func (nl NocList) Less(i, j int) bool

func (NocList) Swap

func (nl NocList) Swap(i, j int)

type NodeMatchEvent

type NodeMatchEvent struct {
	NodeName   string
	NodeUpdate bool
}

type NodeToConfig

type NodeToConfig map[string]*v1alpha1.NodeOvercommitConfig

Jump to

Keyboard shortcuts

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