Skip to content

Commit

Permalink
create_disk: add version field to aleph file
Browse files Browse the repository at this point in the history
In the osbuild aleph file work we decided to use `version:` instead
of `build:` here because our COSA build ID isn't exactly ties to the
version of the ostree commit and is essentially a COSA concept. While
we transition to osbuild let's just add a version field here too in
COSA and lazily set it to buildid, even if it's not 100% accurate.

Also, fix a test that checks the `.build` field from .coreos-aleph-version.json
  • Loading branch information
dustymabe committed Dec 4, 2023
1 parent efc4422 commit c2d37f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mantle/cmd/kola/testiso.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ StandardError=kmsg+console
ExecStart=/bin/sh -c "journalctl -t coreos-installer-service | /usr/bin/awk '/[Dd]ownload/ {exit 1}'"
ExecStart=/bin/sh -c "/usr/bin/udevadm settle"
ExecStart=/bin/sh -c "/usr/bin/mount /dev/disk/by-label/root /mnt"
ExecStart=/bin/sh -c "/usr/bin/jq -er '.[\"build\"] == \"%s\"' /mnt/.coreos-aleph-version.json"
ExecStart=/bin/sh -c "/usr/bin/jq -er '.[\"version\"] == \"%s\"' /mnt/.coreos-aleph-version.json"
ExecStart=/bin/sh -c "/usr/bin/jq -er '.[\"ostree-commit\"] == \"%s\"' /mnt/.coreos-aleph-version.json"
[Install]
RequiredBy=coreos-installer.target
Expand Down
6 changes: 6 additions & 0 deletions src/create_disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,11 @@ test -d "${deploy_root}" || (echo "failed to find $deploy_root"; exit 1)
#
# build: The coreos-assembler build ID; today we support
# having the same ostree commit in different image builds.
# version: same value as build for now, even though version is
# not exactly the same as build ID, this will ease
# transition to using osbuild where it's defined
# appropriately and build: isn't there:
# https://github.com/osbuild/osbuild/pull/1475
# ref: The ostree ref used; useful for cross-checking.
# ostree-commit: Similar to `ref`; one can derive this from looking
# at the coreos-assembler builds, but it's very
Expand All @@ -395,6 +400,7 @@ test -d "${deploy_root}" || (echo "failed to find $deploy_root"; exit 1)
cat > $rootfs/.coreos-aleph-version.json << EOF
{
"build": "${buildid}",
"version": "${buildid}",
"ref": "${ref}",
"ostree-commit": "${commit}",
"imgid": "${imgid}"
Expand Down

0 comments on commit c2d37f4

Please sign in to comment.