feat: apply converges the overlays and Monit's checks of the manifests (0041 step 3) #58
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Keel-Linux/keel!58
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/manifest-apply"
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?
Step 3 of the first implementation of handbook decision 0041, without the firewall: the spec's
appliance,installationandoverlays;apply --systemconverges the overlays' units and writes Monit's derived checks;inspectanddiffread them. The firewall is #59, opt-in and for cloud advanced only, as the maintainer scoped it on 2026-09-30.What changes
keel/spec/validate_appliance.py,keel/manifest/facts.py): the three sections,enabledordisabledonly (on, off and ask refused with the reason), and rules 25 to 27 held against the manifests under the command's root: every overlay of the resolved chain written out, requires enabled, manifest-declared secrets accepted and rendered asKEEL_SECRET_<NAME>withgeneraterefused where the manifest says never,app.optionstyped and required ones present.spec validategains--root. A spec that names no appliance is checked exactly as before.keel/system/appliance.py): enabled enables and starts, disabled stops and disables, inrequiresorder, only what differs. Never masks or unmasks; a masked unit is refused.systemctl --rootunder a tree.keel/system/crowdsec.py, tracker#47): on the first enable, the missing parts only: an emptyonline_api_credentials.yaml,cscli machines add --auto --force,cscli capi registeras anAttempt(offline it is said and survived; CrowdSec runs on its local API alone), andcscli bouncers add, whose key goes from stdout to the.localfile, mode 0600, and nowhere else. Apending-registrationleft by the Debian postinst is replaced too: it keeps the bouncer's unit from starting (found in the real test). Nothing is made under--root.keel/manifest/monit.py): the appliance's own processes and checks and those of enabled overlays only;check programonsystemctl is-active, restart through systemd, the manifest's restart limit thenunmonitorand akeel notify --check restarts. Written always to/etc/keel/monit/keel-manifest.conf, linked from/etc/monit/conf.d/only whilemonitor.enabledis true, thenmonit -tand a reload.keel notifygains--check service|restarts,--name,--unit.appliance.namefrom the top of the installed chain, overlay states from systemd, the mode and unit-less overlays from the emitted spec; diff compares states with systemd, the derived file whole and its include.Real test (0041 criterion)
Fresh LXC container on the test VM from the B4 image, with
keel_0.13.0and the four common#20 packages built from 19.x and installed in one transaction, Core's manifest from the format, the identity files deleted as tracker#47 says the image build will. CrowdSec disabled, enabled, disabled: each converged, each second apply0 change(s), 0 failed, eachkeel diffexit 0,monit -tOK after each, the Monit file gained exactlykeel-unit-crowdsec,keel-unit-firewall-bouncer,keel-check-crowdsec-lapiand the file after disabling is byte-identical to the first. Offline CAPI (api.crowdsec.net pointed at ::1):capi registernot done and said, both units active, LAPI answers, second apply 0 changes, diff clean.Test plan
set -o pipefail; coverage run -m pytest tests: 2172 passed; coverage 99 percent, new modules 100monit -t(5.34.3) locally and on the containerFindings for other steps:
keel-overlay-crowdsecunder iptables-legacy needsipset(the bouncer dies with "unable to find ipset"); tracker#47's image-build list should add/var/lib/crowdsec/pending-registration; Core'spostfixcheck at::1fails on TurnKey (inet_interfaces = localhostbinds 127.0.0.1 only), for keel-core in step 4.