[WIP] baseosmgr: gate EVE-k vs non-EVE-k upgrade block on volumes - #5993
Closed
eriknordmark wants to merge 3 commits into
Closed
[WIP] baseosmgr: gate EVE-k vs non-EVE-k upgrade block on volumes#5993eriknordmark wants to merge 3 commits into
eriknordmark wants to merge 3 commits into
Conversation
After zedagent restarts pubVolumeConfig, volumemgr has reconciled its on-disk recovery (populateExistingVolumesFormat*) with the controller- intended set into VolumeStatus. Signal restart on pubVolumeStatus at the tail of handleVolumeRestart so subscribers can use Restarted() as a gate on the published set being in a known state, rather than Synchronized() which only reflects the socket-level handshake. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The cross-flavor BaseOs upgrade between EVE-k and non-EVE-k was unconditionally rejected. The rationale is that /persist/vault/volumes layout differs across flavors, so existing volumes can break across the switch. On a device with no volumes there is nothing to disturb, so the block is overly strict. Subscribe to VolumeConfig (from zedagent) and VolumeStatus (from volumemgr) in baseosmgr and only error out on the flavor mismatch when either set is non-empty. Wait at startup for both publications to signal restart so the first BaseOsConfig after boot evaluates against the true volume set; Synchronized() is not sufficient because it only confirms the socket handshake. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Test sample DiskPath used /persist/volumes/vol1; canonical path under SealedDirName is /persist/vault/volumes. Update so the test exercises a realistic value. Signed-off-by: eriknordmark <erik@zededa.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #5993 +/- ##
==========================================
+ Coverage 20.68% 21.09% +0.40%
==========================================
Files 491 501 +10
Lines 90599 92345 +1746
==========================================
+ Hits 18744 19479 +735
- Misses 70274 71105 +831
- Partials 1581 1761 +180 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The cross-flavor BaseOs upgrade between EVE-k and non-EVE-k flavors is
unconditionally rejected by
baseosmgrwith "Upgrade to EVE-k ... isnot supported" (or its inverse). The rationale is that the on-disk
/persistlayout used by volumes differs across flavors, so existingvolumes can break across the switch. On a device with no volumes there
is nothing to disturb, so the block is overly strict.
This PR gates the check on volume presence:
baseosmgrsubscribes toVolumeConfig(from zedagent) andVolumeStatus(from volumemgr). When either set is non-empty, thecross-flavor mismatch errors out as before — the error now reads
... is not supported while volumes exist. With both sets empty theupgrade proceeds.
restart, so the first
BaseOsConfigarrival after boot evaluatesagainst the true volume set.
Synchronized()is insufficient — itonly confirms the socket-level handshake and can fire before zedagent
has parsed its first
EdgeDevConfig.volumemgrnow callspubVolumeStatus.SignalRestarted()at the tailof
handleVolumeRestart. After zedagent restartspubVolumeConfig,volumemgr has reconciled its on-disk recovery
(
populateExistingVolumesFormat*) with the controller-intended setinto
VolumeStatus, so subscribers have aRestarted()gate toreason about.
pkg/pillar/types/diskmetrics_test.goused/persist/volumes/vol1as a sampleDiskPath; updated to/persist/vault/volumes/vol1to match the canonical path(
SealedDirName + "/volumes").How to test and validate this PR
Same-flavor regression (covered by eden):
eden test ./tests/update_eve_image -e update_eve_image_oci— PASSlocally (12 min).
eden test ./tests/update_eve_image -e update_eve_image_http— PASSlocally (~10 min).
flow and
BaseOsConfigis processed across reboots.Cross-flavor relaxation (manual):
BaseOsConfigpointing at anEVE-k image from a running non-EVE-k image (or vice versa). The prior
behavior errored out; the new behavior allows the upgrade.
block returns with the new wording.
Changelog notes
Checklist
covered by the error-message text
qemu
mark-ready