Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigMapRuleCollector ¶
type ConfigMapRuleCollector struct {
// contains filtered or unexported fields
}
ConfigMapRuleCollector is used to collect rules from a kubernetes configmaps. Rules will be collect from the configmaps in the sensor namespace with the label provided via the sensorRuleConfigMapLabel field.
func NewConfigMapRuleCollector ¶
func NewConfigMapRuleCollector(clientSet *kubernetes.Clientset, sensorNamespace string, sensorRuleConfigMapLabel string) *ConfigMapRuleCollector
NewConfigMapRuleCollector returns a new ConfigMapRuleCollector.
func (ConfigMapRuleCollector) Collect ¶
func (cmrc ConfigMapRuleCollector) Collect(ctx context.Context) (map[rules.RuleID]*rules.Rule, error)
Collect will return all rules from the configmaps in the sensor namespace with the label configured via sensorRuleConfigMapLabel. Only one copy of the duplicate rules will be returned. If the configmap does not exist or the rules are invalid, an empty map will be returned. If unable to list all configmaps in the sensor namespace, an error will be returned.
func (ConfigMapRuleCollector) StartRuleCollector ¶
func (cmrc ConfigMapRuleCollector) StartRuleCollector(ctx context.Context, sensorRI SensorReloadInterface)
StartRuleCollector will continuously listen for rule configmap changes and will reload the rules of the provided sensor. Cancelling the provided context will stop the collector.