controller

package
v0.0.0-...-fc9e8e4 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: GPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KernelIDPath = "/proc/sys/kernel/random/boot_id"
	TrapIdLabel  = "trap-id"
)

Variables

View Source
var (
	KernelID string = ""
)

Functions

func HiveDataContainerCmp

func HiveDataContainerCmp(hiveData hivev1alpha1.HiveData, pod corev1.Pod, containerStatus corev1.ContainerStatus) bool

func HiveDataTrapCmp

func HiveDataTrapCmp(hiveData hivev1alpha1.HiveData, hiveTrap hivev1alpha1.HiveTrap) (bool, error)

func HiveTrapHashID

func HiveTrapHashID(hiveTrap hivev1alpha1.HiveTrap) (string, error)

func NewHiveDataName

func NewHiveDataName(inode uint64, containerStatus corev1.ContainerStatus) string

func Output

func Output(client client.Reader)

func RegexMatch

func RegexMatch(regex string, containerName string) (bool, error)

Types

type HiveDataReconciler

type HiveDataReconciler struct {
	client.Client
	UncachedClient client.Reader
	Scheme         *runtime.Scheme
}

func (*HiveDataReconciler) Reconcile

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

func (*HiveDataReconciler) SetupWithManager

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

type HivePodReconciler

type HivePodReconciler struct {
	client.Client
}

func (*HivePodReconciler) Reconcile

There are two main operations we are concearned about with pods: pod creation and pod termination.

  • creation: upon creation, the controller should send a reconcile request for HivePolicy so that new HiveData will be generated for the new pod.
  • termination: upon termination, the controller should check if each HiveData refers to an existing pod. If it doesn't, then that resource should be eliminated.

Failures are treated as terminations.

func (*HivePodReconciler) SetupWithManager

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

type HivePolicyReconciler

type HivePolicyReconciler struct {
	client.Client
	UncachedClient client.Reader
	Scheme         *runtime.Scheme
}

func (*HivePolicyReconciler) Reconcile

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

The HivePolicy reconciliation is responsible for the following:

  • For each HivePolicy, fetch files' information such as the inode number from the matched container.
  • create HiveData resources with the previously fetched information if not already present.

func (*HivePolicyReconciler) SetupWithManager

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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