controller

package
v0.22.4 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PolicyReconciler

type PolicyReconciler struct {
	client.Client
	Scheme          *runtime.Scheme
	TraceeNamespace string
	TraceeName      string
}

PolicyReconciler is the main controller for the Tracee Policy CRD. It is responsible for updating the Tracee DaemonSet whenever a change is detected in a TraceePolicy object.

func (*PolicyReconciler) Reconcile

func (r *PolicyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is where the reconciliation logic resides. Every time a change is detected in a v1beta1.Policy object, this function will be called. It will update the Tracee DaemonSet, so that the Tracee pods will be restarted with the new policy. It does this by adding a timestamp annotation to the pod template, so that the daemonset controller will rollout a new daemonset ("restarting" the daemonset).

func (*PolicyReconciler) SetupWithManager

func (r *PolicyReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager is responsible for connecting the PolicyReconciler to the main controller manager. It tells the manager that for changes in v1beta1Policy objects, the PolicyReconciler should be invoked.

Jump to

Keyboard shortcuts

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