feat(agent): gate netprobe lifecycle on its AddonAssignment (#3425) #3483
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!3483
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/netprobe-assignment-cutover"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
migrate-netprobe-to-native-addon§2.2 cutover. Moves netprobe off the always-on agent-launched visibility path onto the systemd-service add-on lifecycle, gated on itsAddonAssignment— building on the attach mode from #3482.Routing (
push_loop_config.go)applyVisibilityConfignow takessystemdManaged bool, derived fromnetprobeSystemdAssignmentPresent(configResp.GetAddons())(an enabled netprobesystemd_serviceassignment):applyVisibilityConfigSystemd: switches the supervisor to attach mode (Mode()-gatedStop+StartAttach, so a previously agent-launched netprobe is stopped before systemd owns the socket — no double-run) and hands the config to the sidecar. It always returnstrueso the apply never aborts beforeapplyAddonAssignmentsinstalls the unit later in the same cycle (a synchronous failingApplyConfigthere would deadlock the cutover).applyVisibilityConfigLaunched: the original launch path, byte-for-byte for un-assigned fleets (zero regression), plus aStop+SetDesiredConfig(nil)revert if coming from attach.Apply-on-connect (
netprobe/sidecar.go)SetDesiredConfigstores the latestVisibilityConfig(atomic) and asynchronouslypushDesired(serialized viaapplyMu, last-write-wins);setClientre-triggers it on every (re)connect. So a systemd-managed netprobe gets its full config over IPC — including device bindings, which the bootstrap file does not carry — on startup and after any restart, independent of the gateway poll cadence and theNotModifiedshort-circuit. The push primitive is injectable (applyFn) for tests.sidecarLifecycleManagergainedMode()+StartAttach(); the netprobe sidecar takes aLogger.Why this is safe to land now
The cutover is inert until the control plane seeds a netprobe
AddonAssignment(§3.1) — with no assignment, every fleet stays on the unchanged launch path.Validation
go test -racegreen: routing → attach + revert → stop (TestApplyVisibilityConfigRoutesNetprobeBySupervision), assignment-detection table (TestNetprobeSystemdAssignmentPresent), apply-on-connect applies + nil-clears (TestSidecarSetDesiredConfigApplies). These run in CI viago test ./...(tests-golang.yml).golangci-lint runclean; agent packages build.Next (§2.2 remainder + beyond)
desiredConfigis lost on agent restart; relies on the agent's cached-config replay — verify in §4.x).🤖 Generated with Claude Code
lgtm