sensor

package
v0.13.0-rc Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2020 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//LabelControllerInstanceID is the label which allows to separate application among multiple running controllers.
	LabelControllerInstanceID = sensor.FullName + "/sensor-controller-instanceid"
	// LabelPhase is a label applied to sensors to indicate the current phase of the sensor (for filtering purposes)
	LabelPhase = sensor.FullName + "/phase"
	// LabelComplete is the label to mark sensors as complete
	LabelComplete = sensor.FullName + "/complete"
)

Labels

Variables

This section is empty.

Functions

func AreAllDependenciesResolved added in v0.13.0

func AreAllDependenciesResolved(sensor *v1alpha1.Sensor) bool

AreAllDependenciesResolved checks whether all event dependencies are resolved

func GetNodeByName

func GetNodeByName(sensor *v1alpha1.Sensor, nodeName string) *v1alpha1.NodeStatus

GetNodeByName returns a copy of the node from this sensor for the nodename for events this node name should be the name of the event

func InitializeNode

func InitializeNode(sensor *v1alpha1.Sensor, nodeName string, nodeType v1alpha1.NodeType, logger *logrus.Logger, messages ...string) *v1alpha1.NodeStatus

create a new node

func IsDependencyResolved added in v0.13.0

func IsDependencyResolved(sensor *v1alpha1.Sensor, nodeName string) bool

IsDependencyResolved checks whether a dependency is resolved.

func MarkNodePhase

func MarkNodePhase(sensor *v1alpha1.Sensor, nodeName string, nodeType v1alpha1.NodeType, phase v1alpha1.NodePhase, event *apicommon.Event, logger *logrus.Logger, message ...string) *v1alpha1.NodeStatus

MarkNodePhase marks the node with a phase, returns the node

func MarkResolvedAt added in v0.13.0

func MarkResolvedAt(sensor *v1alpha1.Sensor, nodeName string) *v1alpha1.NodeStatus

func MarkUpdatedAt added in v0.13.0

func MarkUpdatedAt(sensor *v1alpha1.Sensor, nodeName string) *v1alpha1.NodeStatus

func PersistUpdates

func PersistUpdates(client sensorclientset.Interface, sensorObj *v1alpha1.Sensor, log *logrus.Logger) (*v1alpha1.Sensor, error)

PersistUpdates persists the updates to the Sensor resource

func ReapplyUpdate

func ReapplyUpdate(sensorClient sensorclientset.Interface, sensor *v1alpha1.Sensor) error

Reapply the update to sensor

func ValidateSensor

func ValidateSensor(s *v1alpha1.Sensor) error

ValidateSensor accepts a sensor and performs validation against it we return an error so that it can be logged as a message on the sensor status the error is ignored by the operation context as subsequent re-queues would produce the same error. Exporting this function so that external APIs can use this to validate sensor resource.

Types

type Controller added in v0.13.0

type Controller struct {
	// ConfigMap is the name of the config map in which to derive configuration of the controller
	ConfigMap string
	// Namespace for controller
	Namespace string
	// Config is the controller'sensor configuration
	Config ControllerConfig
	// contains filtered or unexported fields
}

Controller listens for new sensors and hands off handling of each sensor on the queue to the operator

func NewController added in v0.13.0

func NewController(rest *rest.Config, configMap, namespace string) *Controller

NewController creates a new Controller

func (*Controller) ResyncConfig added in v0.13.0

func (controller *Controller) ResyncConfig(namespace string) error

ResyncConfig reloads the controller config from the configmap

func (*Controller) Run added in v0.13.0

func (controller *Controller) Run(ctx context.Context, threads int)

Run executes the controller

type ControllerConfig added in v0.13.0

type ControllerConfig struct {
	// InstanceID is a label selector to limit the controller'sensor watch of sensor jobs to a specific instance.
	// If omitted, the controller watches sensors that *are not* labeled with an instance id.
	InstanceID string
	// Namespace is a label selector filter to limit controller'sensor watch to specific namespace
	Namespace string
}

ControllerConfig contain the configuration settings for the controller

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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