Documentation
¶
Overview ¶
Package agent runs the in-cluster continuous loop: collect → evaluate per target → ClusterReadiness CRD status (always) → push snapshot to the server on content change. The agent's local value never depends on server availability (spec §3).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AgentVersion = "dev"
AgentVersion is stamped into CRD status and push envelopes. The CLI sets it from the build version; "dev" otherwise.
Functions ¶
func Run ¶
func Run(ctx context.Context, clients collect.Clients, dyn dynamic.Interface, apiext apiextensionsclient.Interface, k kb.KB, cfg Config) error
Run executes the continuous loop until ctx is canceled (returns nil — a cancel is a graceful stop, not an error). The first tick runs immediately; later ticks fire every Interval ±10% jitter. Tick errors are logged and counted, never fatal: the loop never dies on a tick error.
Types ¶
type Config ¶
type Config struct {
Interval time.Duration // default 10m, min 1m
ServerURL string // optional; "" = CRD-only mode
ServerToken string // bearer for push
ClusterName string // human label sent to server; default = ClusterID
CRName string // default crd.DefaultName
TeamLabel string // default "team"
ForceSyncEvery time.Duration // default 1h: push even if hash unchanged
}
Click to show internal directories.
Click to hide internal directories.