fix: an overlay an upgrade adds to the chain takes its default #88
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!88
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/overlay-new-in-chain"
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?
What broke
keel-core 0.1.3 added
vipto Core's overlays. Afterapt full-upgrade(keel 0.20.0, keel-core 0.1.3, keel-overlay-vip 0.1.1), every keel command on two Keel Web nodes failed:Error: /etc/keel/instance.yaml: overlays.vip: not declared; every overlay of the chain of web is written out, enabled or disabled (decisions 0027, 0041)Rule 25 held the spec against the chain as it is now, so any overlay added to a chain made every spec written before it invalid.
The fix: option (a)
An overlay of the chain that the spec does not declare, and did not declare when it was last applied, takes the default its manifest gives for
installation.mode:overlays.vip: not declared (default: disabled): the chain of web gained it after this spec was last applied, so it takes the manifest's default for simple; write it outapply --systemconverges it to that defaultdiffreportsoverlays.vip: not declared (default: disabled, observed disabled), or drift when the machine is off the defaultinspectalready wrote it out from systemd, so a spec written by inspect is complete (now tested)To tell "the chain gained it" from "the operator dropped it",
apply --systemrecords the overlays the spec itself declared (never the filled defaults) in/var/lib/keel/spec/overlays.yamlafter a run that did not fail. An overlay in that record that the spec leaves out is still the rule 25 error. With no record (noapply --systemsince this version), nothing left out is refused. No default is taken withoutinstallation.mode, or when the default isask.Why (a) and not (b)
0027 makes the spec the operator's document and the source of truth; 0041 rule 25 wants it explicit. Option (b), a maintainer script editing
/etc/keel/instance.yaml, would change a file the operator owns, replays elsewhere and may keep under configuration management, without anyone choosing it. Option (a) keeps the spec untouched and keeps the explicit-spec intent for everything the operator wrote, while the emitted spec (inspect, 0039's re-emission) still writes the new overlay out. The record uses the spec at its last apply rather than a manifest version: the manifest carries no per-overlay version, and adding one would raisemanifest_version.Rule 25 needs an amendment for this: Keel-Linux/handbook#54 (proposed, for approval).
Tests
tests/test_spec_new_overlay.py, written first (red on main):vipkeeps validating, applying and diffing after the chain gainsvip, with the warning;vipbehaves as before (no warning,same (disabled)), and once applied, dropping it is the error;keel inspectwritesoverlays.vip: disabled;ask, no mode, requires held against defaults, the record's reading, writing and failure to write.Locally the suite passes except the socket tests in
test_mesh_channel.py,test_mesh_vipbridge.pyandtest_mesh_bridge.py, which fail the same way onmainin this sandbox.Version 0.20.1, with a changelog entry.