debian-forge-composer/internal
Tomas Hozza 8713b8002a Move kernelVerStr() from distros to rpmmd
Move the `kernelVerStr()` function duplicated in many
distro definitions to the `rpmmd` package as
`GetVerStrFromPackageSpecListPanic()`.

I could not come up with a better name, sorry.

This will prevent creating another copy of the code in rhel-84 for
the `gce` image.

This change initially exposed a bug in the original implementation of
`kernelVerStr()`. Since on the first line, we allocate an empty structure
into `kernelPkg` variable, it can never be `nil` and the function never
panicked even if there was no `kernel` package in the PackageSpec list.

Fix all unit tests to provide valid arguments when calling `Manifest()`
method of image types.

Signed-off-by: Tomas Hozza <thozza@redhat.com>

kernelVerStr fixup

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2022-02-18 09:26:35 +01:00
..
auth jwt: support multiple key providers 2022-01-31 20:40:22 +00:00
blueprint internal: mandate installation device for the simplified installer 2021-11-18 18:10:09 +01:00
boot tests: update IDs in Openstack image boot test 2022-02-14 12:13:18 +02:00
client Weldr API: introduce Image Type denylist for filtering exposed images 2021-08-02 18:51:03 +02:00
cloud cmd/osbuild-service-maintenance: GCP deletes by image name 2022-02-15 18:22:39 +01:00
cloudapi cloudapi: test repository config conversion function 2022-02-14 17:38:41 +01:00
common internal/common: introduce function to convert data sizes 2021-11-02 18:32:47 +01:00
crypt crypt: add automatic darwin support 2020-07-17 07:48:22 +02:00
disk gosec: G404 - Use of weak rng 2021-12-13 12:17:30 +02:00
distro Move kernelVerStr() from distros to rpmmd 2022-02-18 09:26:35 +01:00
distroregistry distro: add an alias for RHEL 8.7 2022-02-08 17:37:36 +01:00
jobqueue fsjobqueue: refactor to allow dequeuing by multiple criteria 2022-02-16 17:14:36 +01:00
jsondb gosec: G306-WriteFile permissions higher than 0600 2021-12-13 12:17:30 +02:00
kojiapi worker/server: typesafe Job and JobStatus 2022-02-01 20:28:40 +00:00
mocks test: Add fixture support for blueprint changes 2022-02-15 10:10:21 +01:00
osbuild1 osbuild: test Write() on nil Result receivers 2021-11-17 15:21:40 +01:00
osbuild2 Move kernelCmdlineStageOptions() from distros to osbuild2 2022-02-18 09:26:35 +01:00
ostree ostree: add test for VerifyRef() 2021-06-18 14:02:09 +01:00
prometheus metrics: change job metrics namespace 2022-02-08 15:57:12 +01:00
reporegistry reporegistry: Add a DistroHasRepos helper function 2021-07-12 08:58:42 +02:00
rhsm internal/rhsm: implement fallback to the previous mechanism 2021-08-09 12:40:23 +02:00
rpmmd Move kernelVerStr() from distros to rpmmd 2022-02-18 09:26:35 +01:00
store store: Filter out blank blueprint name 2022-02-15 10:10:21 +01:00
target Add support for OCI upload provider 2022-01-28 15:16:47 +01:00
test gosec: G204 - Subproccess launched as function arg 2021-12-13 12:17:30 +02:00
upload Relax TCP timeouts for koji connections 2022-02-10 14:58:10 +01:00
weldr weldr: Check for missing undo blueprint 2022-02-15 10:10:21 +01:00
worker DepsolveJob: rename struct field for consistency 2022-02-14 17:38:41 +01:00
tools.go go: vendor the oapi-codegen cmd 2021-02-01 15:32:58 +01:00