sensor

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2019 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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, log *zerolog.Logger, messages ...string) *v1alpha1.NodeStatus

create a new node

func MarkNodePhase

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

MarkNodePhase marks the node with a phase, returns the node

func NewSensorResourceContext added in v0.8.2

func NewSensorResourceContext(s *v1alpha1.Sensor, controller *SensorController) sResourceCtx

NewSensorResourceContext returns new sResourceCtx

func PersistUpdates

func PersistUpdates(client sclient.Interface, sensor *v1alpha1.Sensor, controllerInstanceId string, log *zerolog.Logger) (*v1alpha1.Sensor, error)

PersistUpdates persists the updates to the Sensor resource

func ReapplyUpdate

func ReapplyUpdate(sensorClient sclient.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 SensorController

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

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

func NewSensorController

func NewSensorController(rest *rest.Config, configMap, namespace string) *SensorController

NewSensorController creates a new Controller

func (*SensorController) ResyncConfig

func (c *SensorController) ResyncConfig(namespace string) error

ResyncConfig reloads the sensor-controller config from the configmap

func (*SensorController) Run

func (c *SensorController) Run(ctx context.Context, ssThreads, eventThreads int)

Run executes the sensor-controller

type SensorControllerConfig

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

	// Namespace is a label selector filter to limit sensor-controller's watch to specific namespace
	Namespace string
}

SensorControllerConfig contain the configuration settings for the sensor-controller

Jump to

Keyboard shortcuts

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