Documentation ¶
Index ¶
- func GetNodeByName(sensor *v1alpha1.Sensor, nodeName string) *v1alpha1.NodeStatus
- func InitializeNode(sensor *v1alpha1.Sensor, nodeName string, nodeType v1alpha1.NodeType, ...) *v1alpha1.NodeStatus
- func MarkNodePhase(sensor *v1alpha1.Sensor, nodeName string, nodeType v1alpha1.NodeType, ...) *v1alpha1.NodeStatus
- func NewSensorResourceContext(s *v1alpha1.Sensor, controller *SensorController) sResourceCtx
- func PersistUpdates(client sclient.Interface, sensor *v1alpha1.Sensor, controllerInstanceId string, ...) (*v1alpha1.Sensor, error)
- func ReapplyUpdate(sensorClient sclient.Interface, sensor *v1alpha1.Sensor) error
- func ValidateSensor(s *v1alpha1.Sensor) error
- type SensorController
- type SensorControllerConfig
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 *logrus.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 *logrus.Logger, message ...string) *v1alpha1.NodeStatus
MarkNodePhase marks the node with a phase, returns the node
func NewSensorResourceContext ¶
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 *logrus.Logger) (*v1alpha1.Sensor, error)
PersistUpdates persists the updates to the Sensor resource
func ReapplyUpdate ¶
Reapply the update to sensor
func ValidateSensor ¶
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 { // EventSource 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
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