debian-forge-composer/internal/common
Tomas Hozza af65baa6fe worker/osbuild: use os-release to determine host OS
When running an osbuild job, we read `/etc/redhat-release` to get the
host OS name to attach as metadata to the job result.

Only Fedora and RHEL ship this file, which makes the osbuild job always
fail on other distributions.

The main reason to report host OS back to the worker server is due to
Koji composes and the koji-finalize job, which pushes it to Koji. The
motivation is to have enough information to potentially re-instantiate
/ identify the original builder host OS. There are no specific
requirements on the string.

Modify the code to use `/etc/os-release` to determine the host OS. Fall
back to using `linux` as the host OS, in case reading `os-release`
fails, log the error and continue with the job. The `linux` fallback is
suggested by the `os-release` spec [1]

[1] https://www.freedesktop.org/software/systemd/man/os-release.html#ID=

Co-authored-by: Achilleas Koutsou <achilleas@koutsou.net>
2022-08-25 08:25:35 +01:00
..
constants.go internal/common: introduce git revision and rpm version 2021-09-24 14:13:23 +02:00
distro.go worker/osbuild: use os-release to determine host OS 2022-08-25 08:25:35 +01:00
distro_test.go Move GetRedHatRelease() and GetHostDistroName() to common package 2022-06-10 14:48:18 +01:00
echo_logrus.go cloudapi: use Logrus as default logger in Echo 2021-09-30 18:34:05 +02:00
helpers.go internal/common: introduce function to convert data sizes 2021-11-02 18:32:47 +01:00
helpers_test.go internal/common: introduce function to convert data sizes 2021-11-02 18:32:47 +01:00
operation_id.go cloudapi: V2 2021-09-14 15:32:21 +02:00
pointers.go internal/common: add function to get a pointer to string literal 2021-08-02 19:05:09 +02:00
pointers_test.go internal/common: add function to get a pointer to string literal 2021-08-02 19:05:09 +02:00
states.go fix: unused function arg 2021-07-02 10:38:04 +02:00
states_test.go weldr: move common.ComposeState to weldr 2020-11-09 14:17:19 +01:00