nodematch

package
v0.0.0-...-c7dd6ca Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateMatch

func ValidateMatch(match *flipopv1alpha1.Match) error

ValidateMatch returns an error if the provided match spec is invalid.

Types

type Controller

type Controller struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Controller watches Kubernetes nodes and pods and enables or disables them with the provided action based upon the provided criteria.

func NewController

func NewController(log logrus.FieldLogger, kubeCS kubernetes.Interface, action NodeEnableDisabler) *Controller

NewController builds a new node match Controller.

func (*Controller) IsCriteriaEqual

func (m *Controller) IsCriteriaEqual(match *flipopv1alpha1.Match) bool

IsCriteriaEqual returns true if the specified criteria match the current criteria.

func (*Controller) OnAdd

func (m *Controller) OnAdd(obj interface{}, _ bool)

OnAdd implements the shared informer ResourceEventHandler for corev1.Pod & corev1.Node.

func (*Controller) OnDelete

func (m *Controller) OnDelete(obj interface{})

OnDelete implements the shared informer ResourceEventHandler for corev1.Pod & corev1.Node.

func (*Controller) OnUpdate

func (m *Controller) OnUpdate(_, newObj interface{})

OnUpdate implements the shared informer ResourceEventHandler for corev1.Pod & corev1.Node.

func (*Controller) SetCriteria

func (m *Controller) SetCriteria(match *flipopv1alpha1.Match)

SetCriteria sets the match criteria based on the match spec.

func (*Controller) Start

func (m *Controller) Start(ctx context.Context)

Start begins asynchronous execution of the node match controller.

func (*Controller) Stop

func (m *Controller) Stop()

Stop terminates execution of the node match controller and waits for it to finish.

type NodeEnableDisabler

type NodeEnableDisabler interface {
	EnableNodes(...*corev1.Node)
	DisableNodes(...*corev1.Node)
}

NodeEnableDisabler describes a controller which can enable or disable sets of nodes, based upon decisions reached by the node match controller.

Jump to

Keyboard shortcuts

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