controller

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultStatusFlushInterval = 30 * time.Second

DefaultStatusFlushInterval is the flush cadence used by the daemon.

Variables

This section is empty.

Functions

func NewPodWatcher

func NewPodWatcher(client kubernetes.Interface, nodeName string, eventHandlers []events.PodEventHandler, nsHandlers []events.NamespaceEventHandler) *podWatcher

Types

type RuntimePolicyMgr

type RuntimePolicyMgr struct {
	// contains filtered or unexported fields
}

func (*RuntimePolicyMgr) HasSynced

func (m *RuntimePolicyMgr) HasSynced() bool

expose HasSynced so we can wait till sync is complete from main before starting the pod sync

func (*RuntimePolicyMgr) Start

func (m *RuntimePolicyMgr) Start(ctx context.Context) error

type ServiceChangeNotifier

type ServiceChangeNotifier interface {
	AddChangeHandler(h func(namespace, name string))
}

ServiceChangeNotifier reports that the addresses behind a Service may have changed. It is satisfied by *services.Resolver.

type StatusWriter

type StatusWriter struct {
	// contains filtered or unexported fields
}

StatusWriter turns the RuntimePolicy event stream into this node's shard of each policy's status. Every daemon in the DaemonSet writes the same cluster-scoped object, so a node only ever replaces its own entry in status.nodes.

func NewStatusWriter

func NewStatusWriter(client v1alpha1client.Interface, nodeName string, interval time.Duration, log logr.Logger, nodeGone func(name string) bool) *StatusWriter

NewStatusWriter builds a StatusWriter for this node. A non-positive interval falls back to DefaultStatusFlushInterval.

func (*StatusWriter) Flush

func (s *StatusWriter) Flush(ctx context.Context) error

Flush writes every dirty policy's shard. It is exported so the daemon (and tests) can force a write without waiting for the interval.

func (*StatusWriter) RecordCondition

func (s *StatusWriter) RecordCondition(policyUID, policyName string, cond metav1.Condition)

RecordCondition stores a condition to be merged into the policy's status on the next flush. Re-recording an identical condition is a no-op so a manager that reports the same condition on every event does not cause API churn.

func (*StatusWriter) Run

func (s *StatusWriter) Run(ctx context.Context) error

Run flushes dirty policy statuses every interval, and once more when ctx is cancelled so the last observation is not lost on shutdown.

func (*StatusWriter) RuntimePolicyEvent

func (s *StatusWriter) RuntimePolicyEvent(res *compiler.EvaluationResult, eventType string) error

RuntimePolicyEvent caches the policy's identity and mode.

Jump to

Keyboard shortcuts

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