Update to 32

Resolves: rhbz#1972427
This commit is contained in:
Tom Gundersen 2021-08-29 10:11:01 +00:00
parent faa4908d14
commit 7820efec4d
5 changed files with 15 additions and 10875 deletions

1
.gitignore vendored
View File

@ -21,3 +21,4 @@
/osbuild-composer-29.tar.gz
/osbuild-composer-30.tar.gz
/osbuild-composer-31.tar.gz
/osbuild-composer-32.tar.gz

View File

@ -1,75 +0,0 @@
From 85cc7687415a96db017acaf763d53abbc47d993f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Budai?= <ondrej@budai.cz>
Date: Mon, 16 Aug 2021 12:56:55 +0200
Subject: [PATCH] test/image: fix pipeline exports for v2 manifests
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Previously, we just assumed that all test manifests are of version 1, or we
should export the pipeline named assembler. However, this is no longer true
in RHEL 8.5 and 9 - they are only manifest v2 and they don't have a pipeline
named assembler.
This commit introduces a new way to guess the export name - if the manifest
is of version 1, we just export the assembler. In the case v2 manifest, the
last pipeline is exported.
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
---
cmd/osbuild-image-tests/main_test.go | 32 +++++++++++++++++++++++++---
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/cmd/osbuild-image-tests/main_test.go b/cmd/osbuild-image-tests/main_test.go
index f6cbccc9..f73bab3d 100644
--- a/cmd/osbuild-image-tests/main_test.go
+++ b/cmd/osbuild-image-tests/main_test.go
@@ -482,6 +482,34 @@ func testImage(t *testing.T, testcase testcaseStruct, imagePath string) {
}
}
+// guessPipelineToExport return a best-effort guess about which
+// pipeline should be exported when running osbuild for the testcase
+//
+// If this function detects that this is a version 1 manifest, it
+// always returns "assembler"
+//
+// For manifests version 2, the name of the last pipeline is returned.
+func guessPipelineToExport(rawManifest json.RawMessage) string {
+ const v1ManifestExportName = "assembler"
+ var v2Manifest struct {
+ Version string `json:"version"`
+ Pipelines []struct {
+ Name string `json:"name,omitempty"`
+ } `json:"pipelines"`
+ }
+ err := json.Unmarshal(rawManifest, &v2Manifest)
+ if err != nil {
+ // if we cannot unmarshal, let's just assume that it's a version 1 manifest
+ return v1ManifestExportName
+ }
+
+ if v2Manifest.Version == "2" {
+ return v2Manifest.Pipelines[len(v2Manifest.Pipelines)-1].Name
+ }
+
+ return v1ManifestExportName
+}
+
// runTestcase builds the pipeline specified in the testcase and then it
// tests the result
func runTestcase(t *testing.T, testcase testcaseStruct, store string) {
@@ -494,9 +522,7 @@ func runTestcase(t *testing.T, testcase testcaseStruct, store string) {
require.NoError(t, err, "error removing temporary output directory")
}()
- // NOTE(akoutsou) 1to2t: new v2 manifests name their last pipeline
- // "assembler" for compatibility with v1
- exports := []string{"assembler"}
+ exports := []string{guessPipelineToExport(testcase.Manifest)}
err = runOsbuild(testcase.Manifest, store, outputDirectory, exports)
require.NoError(t, err)
--
2.31.1

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
%global goipath github.com/osbuild/osbuild-composer
Version: 31
Version: 32
%gometa
@ -28,8 +28,7 @@ ExcludeArch: i686
License: ASL 2.0
URL: %{gourl}
Source0: %{gosource}
Patch0: 0001-PR-1645-test-image-fix-pipeline-exports-for-v2-manifests.patch
Patch1: 0002-PR-1638-fix-ami.patch
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
BuildRequires: systemd
@ -226,6 +225,9 @@ install -m 0644 -vp test/data/koji/* %{buildroot}%{_d
install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/x509
install -m 0644 -vp test/data/x509/* %{buildroot}%{_datadir}/tests/osbuild-composer/x509/
install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/openshift
install -m 0644 -vp test/data/openshift/* %{buildroot}%{_datadir}/tests/osbuild-composer/openshift/
install -m 0755 -vd %{buildroot}%{_datadir}/tests/osbuild-composer/schemas
install -m 0644 -vp internal/jobqueue/dbjobqueue/schemas/* %{buildroot}%{_datadir}/tests/osbuild-composer/schemas/
@ -277,8 +279,8 @@ The core osbuild-composer binary. This is suitable both for spawning in containe
Summary: The worker for osbuild-composer
Requires: systemd
Requires: qemu-img
Requires: osbuild >= 29
Requires: osbuild-ostree >= 29
Requires: osbuild >= 30
Requires: osbuild-ostree >= 30
# remove in F34
Obsoletes: golang-github-osbuild-composer-worker < %{version}-%{release}
@ -346,7 +348,10 @@ Requires: python3-lxml
Requires: httpd
Requires: mod_ssl
Requires: openssl
# see https://bugzilla.redhat.com/show_bug.cgi?id=1986333
%if 0%{?rhel} && 0%{?rhel} != 9
Requires: podman-plugins
%endif
Requires: dnf-plugins-core
Requires: skopeo
%if 0%{?fedora}
@ -371,6 +376,9 @@ Integration tests to be run on a pristine-dedicated system to test the osbuild-c
%endif
%changelog
* Sun Aug 29 2021 Tom Gundersen <teg@jklm.no> - 32-1
- New upstream release
* Sun Aug 15 2021 Ondřej Budai <ondrej@budai.cz> - 31-1
- New upstream release

View File

@ -1 +1 @@
SHA512 (osbuild-composer-31.tar.gz) = 4a1acd5f131587f73c91f4185ec7c229ad47de613302aaf792916f49ead4643dcb58482b66a730e86b9040711fef589e2d113c7e21a72772cee4ca63e4bba276
SHA512 (osbuild-composer-32.tar.gz) = 6c04ce63cf0c29660ba2e21ab9c90304eea8ef97924af3bc74ffe7d6745144489704a52aac6592f014bd9f97dd795c1e0332856b41438ff2bc7c4ab22cc3660c