From 33efa9c0c1a2360ec176a9d82c543c3c9fc87d62 Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Thu, 30 Nov 2023 17:38:09 -0500 Subject: [PATCH] create_disk: add version field to aleph file 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 --- mantle/cmd/kola/testiso.go | 2 +- src/create_disk.sh | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/mantle/cmd/kola/testiso.go b/mantle/cmd/kola/testiso.go index 3694ccffcd..7ed083f4ba 100644 --- a/mantle/cmd/kola/testiso.go +++ b/mantle/cmd/kola/testiso.go @@ -172,7 +172,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 diff --git a/src/create_disk.sh b/src/create_disk.sh index a8d5a895a1..7d10b6ee56 100755 --- a/src/create_disk.sh +++ b/src/create_disk.sh @@ -396,6 +396,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 @@ -405,6 +410,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}"