controller

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 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
	TrackerNamespace string
	TrackerName      string
}

PolicyReconciler is the main controller for the Tracker Policy CRD. It is responsible for updating the Tracker DaemonSet whenever a change is detected in a TrackerPolicy 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 Tracker DaemonSet, so that the Tracker 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