From 464a8966b35775109cc32b71e23e67ec320b5435 Mon Sep 17 00:00:00 2001 From: Packit Service Date: Mar 20 2021 04:21:28 +0000 Subject: osbuild-composer-28.2 base --- diff --git a/NEWS.md b/NEWS.md index 63ad12c..3b69543 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,15 @@ # OSBuild Composer - Operating System Image Composition Services +## CHANGES WITH 28.2: + + * The new image type introduced in 28.1 ignores the ostree ref supplied by + the user and always uses the default rhel/8/edge instead. This is now + fixed. + +Contributions from: Achilleas Koutsou + +— Liberec, 2021-03-18 + ## CHANGES WITH 28.1: * OSBuild Composer can now generate Manifests that conform to the new OSBuild diff --git a/internal/distro/rhel84/distro_v2.go b/internal/distro/rhel84/distro_v2.go index 943fbbc..d60f354 100644 --- a/internal/distro/rhel84/distro_v2.go +++ b/internal/distro/rhel84/distro_v2.go @@ -322,7 +322,7 @@ func (t *imageTypeS2) ostreeCommitPipeline(options distro.ImageOptions) *osbuild p.AddStage(osbuild.NewOSTreeCommitStage( &osbuild.OSTreeCommitStageOptions{ - Ref: t.OSTreeRef(), + Ref: options.OSTree.Ref, OSVersion: "8.4", // NOTE: Set on image type? Parent: options.OSTree.Parent, }, @@ -346,7 +346,7 @@ func (t *imageTypeS2) containerTreePipeline(repos []rpmmd.RepoConfig, packages [ p.AddStage(osbuild.NewOSTreePullStage( &osbuild.OSTreePullStageOptions{Repo: "/var/www/html/repo"}, - t.ostreePullStageInputs("org.osbuild.pipeline", "name:ostree-commit", t.OSTreeRef()), + t.ostreePullStageInputs("org.osbuild.pipeline", "name:ostree-commit", options.OSTree.Ref), )) return p } @@ -415,7 +415,7 @@ func (t *imageTypeS2) anacondaTreePipeline(repos []rpmmd.RepoConfig, packages [] p.AddStage(osbuild.NewAnacondaStage(t.anacondaStageOptions())) p.AddStage(osbuild.NewLoraxScriptStage(t.loraxScriptStageOptions())) p.AddStage(osbuild.NewDracutStage(t.dracutStageOptions(kernelVer))) - p.AddStage(osbuild.NewKickstartStage(t.kickstartStageOptions(fmt.Sprintf("file://%s", ostreeRepoPath)))) + p.AddStage(osbuild.NewKickstartStage(t.kickstartStageOptions(fmt.Sprintf("file://%s", ostreeRepoPath), options.OSTree.Ref))) return p } @@ -684,13 +684,13 @@ func (t *imageTypeS2) dracutStageOptions(kernelVer string) *osbuild.DracutStageO } } -func (t *imageTypeS2) kickstartStageOptions(ostreeURL string) *osbuild.KickstartStageOptions { +func (t *imageTypeS2) kickstartStageOptions(ostreeURL, ostreeRef string) *osbuild.KickstartStageOptions { return &osbuild.KickstartStageOptions{ Path: "/usr/share/anaconda/interactive-defaults.ks", OSTree: osbuild.OSTreeOptions{ OSName: "rhel", URL: ostreeURL, - Ref: t.OSTreeRef(), + Ref: ostreeRef, GPG: false, }, } diff --git a/osbuild-composer.spec b/osbuild-composer.spec index 60b541f..d68a1a5 100644 --- a/osbuild-composer.spec +++ b/osbuild-composer.spec @@ -4,7 +4,7 @@ %global goipath github.com/osbuild/osbuild-composer -Version: 28.1 +Version: 28.2 %gometa diff --git a/test/cases/ostree-ng.sh b/test/cases/ostree-ng.sh index b03425f..418be05 100755 --- a/test/cases/ostree-ng.sh +++ b/test/cases/ostree-ng.sh @@ -60,7 +60,7 @@ EOF # Set up variables. OSBUILD_COMPOSER_TEST_DATA=/usr/share/tests/osbuild-composer/ -OSTREE_REF="rhel/8/${ARCH}/edge" +OSTREE_REF="test/rhel/8/${ARCH}/edge" OS_VARIANT="rhel8-unknown" TEST_UUID=$(uuidgen) IMAGE_KEY="osbuild-composer-ostree-test-${TEST_UUID}" @@ -129,7 +129,10 @@ build_image() { else sudo curl --silent --header "Content-Type: application/json" --unix-socket /run/weldr/api.socket http://localhost/api/v1/compose --data "{ \"blueprint_name\": \"$blueprint_name\", - \"compose_type\": \"$image_type\" + \"compose_type\": \"$image_type\", + \"ostree\": { + \"ref\": \"$OSTREE_REF\" + } }" | tee "$COMPOSE_START" fi COMPOSE_ID=$(jq -r '.build_id' "$COMPOSE_START") @@ -488,7 +491,7 @@ done; # Get ostree commit value. greenprint "🕹 Get ostree upgrade commit value" -UPGRADE_HASH=$(curl ${URL}refs/heads/rhel/8/x86_64/edge) +UPGRADE_HASH=$(curl ${URL}refs/heads/"${OSTREE_REF}") # Clean compose and blueprints. greenprint "🧽 Clean up upgrade blueprint and compose"