Repository navigation
feat(rsync-post-upload): take over the supplemental files of the source image - #195
Merged
Merged
Conversation
…ce image An image uploaded under a new name had none of the server-side files that belong to an image by name: the Windows registry patch <name>.reg and the <name>.postsync and <name>.prestart scripts. A sync of such an image after switching start.conf to it ran without them. When <name>.qcow2.info of a successful upload names a sourceimage, the post-upload hook now copies reg, postsync and prestart of that source image as <name>.reg, <name>.postsync and <name>.prestart, like duplicating an image in linuxmuster-tools does. Files the new image already has are never overwritten, so a later upload keeps adapted files. A copied file that mentions the source image name is logged, as a postsync may download files by the old name. A sourceimage that is no qcow2 image, is the image itself or contains path components is ignored. Driver profile assignments are not taken over. The new function is covered by tests/shell/test_rsync-post-upload.sh. Refs #133 Signed-off-by: thomas@linuxmuster.net Assisted-by: Claude
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.
Summary
Server part 3 of #133: an image uploaded under a new name takes over the supplemental files of its source image.
<name>.qcow2.infoarrives (successful upload) and names asourceimage,rsync-post-upload.shcopies<source>.reg,<source>.postsyncand<source>.prestartas<name>.*into the new image dir, likeduplicate()in linuxmuster-tools.Note: <name>.postsync mentions <source>, please check it.), since a postsync may fetch files by the old name.sourceimagethat is not a qcow2 image, is the image itself or contains path components is ignored.Test plan
tests/shell/test_rsync-post-upload.sh(8 tests) green under dash and busybox ash, full shell suite greenlinbo_create_image 2 zznew+linbo_uploadsucceeded, all four files accepted by the new pre-upload hook, info containssourceimage="debian.qcow2", torrent seededdebian.reg/.postsync/.prestart, pre-existingzznew.prestart): re-upload ofzznew.qcow2.infotook over reg and postsync, logged the postsync note, keptzznew.prestart; test image and dummies removed, package hook restoredNote for testing by hand: the rsync client does not wait for the post-xfer hook, so check the result a few seconds after the upload.
🤖 Generated with Claude Code