Merge ~stgraber/simplestreams:master into simplestreams:master

Proposed by Stéphane Graber
Status: Merged
Approved by: Robert C Jennings
Approved revision: c57243c7ed46927c92c18b1fddebf2220c0a0f28
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~stgraber/simplestreams:master
Merge into: simplestreams:master
Diff against target: 26 lines (+5/-2)
1 file modified
tools/make-test-data (+5/-2)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Robert C Jennings (community) Approve
simplestreams-dev Pending
Review via email: mp+371389@code.launchpad.net

Commit message

Add combined_disk1-img_sha256 to download.json

This introduces a new combined_disk1-img_sha256 field for the
"lxd.tar.xz" file type in download entries.

Description of the change

This should be the only change that we need to get LXD virtual machine support to be happy with the existing cloud-images.

This will not caused any issues with any existing LXD servers out there as they specifically look for the squashfs or rootxz right now, all other combined sha256 hashes are just ignored.

To post a comment you must log in.
Revision history for this message
Stéphane Graber (stgraber) wrote :

For now we'll go with the same "lxd.tar.xz" for both VM and container images.

If we need to start distinguishing between the two down the line, we can simply list two different files, both of filetype "lxd.tar.xz" and simply have the combined hashes for containers on one and combined hashes for vms on the other and have them each point to a different tarball.

That wouldn't need any client change to work and wouldn't even need defining any new filetype or anything on the server side.

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Robert C Jennings (rcj) wrote :

I'd like to request a minor fix to keep the code comment up-to-date regarding combined SHAs. Thanks.

review: Needs Fixing
~stgraber/simplestreams:master updated
c57243c... by Stéphane Graber

Update comment to cover combined_disk1-img_sha256

Signed-off-by: Stéphane Graber <email address hidden>

Revision history for this message
Stéphane Graber (stgraber) wrote :

Oh, good catch, updated the branch.

Revision history for this message
Robert C Jennings (rcj) wrote :

Thanks for the update... +1

review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tools/make-test-data b/tools/make-test-data
2index 28b5e5b..a1e183d 100755
3--- a/tools/make-test-data
4+++ b/tools/make-test-data
5@@ -297,8 +297,10 @@ def create_fake_file(prefix, item):
6 # create a combined sha256 for lxd.tar.xz (metadata) and the root fs
7 # - combined_sha256 and combined_rootxz_sha256 for the -root.tar.gz
8 # - combined_squashfs_sha256 for the squashfs
9+ # - combined_disk1-img_sha256 for the img
10 ftype = item['ftype']
11- for name, extension in (('rootxz', '-root.tar.xz'),
12+ for name, extension in (('disk1-img', '.img'),
13+ ('rootxz', '-root.tar.xz'),
14 ('squashfs', '.squashfs')):
15 if (ftype == "lxd.tar.xz" and
16 'combined_{}_sha256'.format(name) not in FAKE_DATA[ftype]):
17@@ -567,7 +569,8 @@ def create_image_data(query_tree, out_d, streamdir):
18 lxd = os.path.basename(path)
19
20 # find calculated combined checksums
21- for name, extension in (('rootxz', '-root.tar.xz'),
22+ for name, extension in (('disk1-img', '.img'),
23+ ('rootxz', '-root.tar.xz'),
24 ('squashfs', '.squashfs')):
25 root = lxd.replace('-lxd.tar.xz', extension)
26 combined = os.path.join(dirname, ','.join([lxd, root]))

Subscribers

People subscribed via source and target branches