Repository navigation
fix(extensions): stage the whole declared set before moving any of it - #5371
Merged
mudler merged 1 commit intoOct 13, 2026
Merged
Conversation
InstallDeclared moved each entry into the target as soon as it had been
downloaded, and only then checked the next entry's file names against the
ones already taken. A clash therefore fired with the earlier images
already on the node, while the error it returned said
extensions A and B both install X: only one of the two would survive,
so nothing was installed
Those earlier images stayed in /var/lib/kairos/extensions and were merged
on the next boot, so the message named a state the node was not in and
the operator had no signal about which half of the set had landed. Seen
on a PXE-booted node where two declared extensions both resolved to the
file name "file": the install was refused and one image was left behind.
Every entry is now staged first and all the names are checked against
each other before anything is moved, so the refusal happens while the
target is still untouched. Peak disk use is unchanged: the images sit in
the staging directories instead of the target.
A rename can still fail once the moves have started, and there is no
filesystem transaction to undo the ones that succeeded. That error now
names what reached the target instead of claiming nothing did.
Fixes kairos-io#5370
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: ci-robbot <ci-robbot@users.noreply.github.com>
mudler
approved these changes
Oct 13, 2026
ci-robbot
pushed a commit
to ci-forks/kairos
that referenced
this pull request
Oct 13, 2026
kairos-io#5371 added a clash spec to agent/pkg/extensions/install_test.go next to the refusal specs on this branch. Both sides only add, so both are kept. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Ettore Di Giacinto <mudler@kairos.io>
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.
InstallDeclaredmoved each entry into the target as soon as it had been downloaded, and only then checked the next entry's file names against the ones already taken. A clash therefore fired with the earlier images already on the node, while the error said:Those images stayed in
/var/lib/kairos/extensionsand were merged on the next boot, so the message named a state the node was not in. The operator was told the install did not happen and had no signal about which half of the set had landed.Seen on a PXE-booted node during the QA of AuroraBoot#878: two declared extensions both resolved to the file name
file(that part is #5369), the install was refused, and one image was left in the target.The change
Every entry is staged first and all the names are checked against each other before anything is moved, so the refusal happens while the target is still untouched.
installToStagingsplits intostageOne(download, record names, reject a name an earlier entry staged) andmoveStaged(rename everything in).Peak disk use is unchanged: the images sit in the staging directories instead of the target, and the moves are still renames on one filesystem.
A rename can still fail once the moves have started, and there is no filesystem transaction to undo the ones that succeeded. That error now names what reached the target instead of claiming nothing did.
Verification
all green.
TestInstallDeclaredLeavesTheTargetEmptyWhenTwoEntriesClashis red onmasterwith the exact leftovers:and green with the change. The six existing
TestInstallDeclared*specs pass unchanged.Fixes #5370
π€ Generated with Claude Code