pkg/utils: Support host operating systems without VERSION_ID#1303
pkg/utils: Support host operating systems without VERSION_ID#1303debarshiray merged 2 commits intocontainers:mainfrom
Conversation
The VERSION_ID field in os-release(5) is optional [1]. It's absent on Arch Linux, which follows a rolling-release model and uses the BUILD_ID field instead: BUILD_ID=rolling A subsequent commit will add built-in support for Arch Linux. Hence, the code to get the default release from the host operating system can no longer assume the presence of the VERSION_ID field in os-release(5). [1] https://www.freedesktop.org/software/systemd/man/os-release.html containers#1303
b50ae8c to
a6c2990
Compare
|
Build failed. ❌ unit-test FAILURE in 9m 00s |
The VERSION_ID field in os-release(5) is optional [1]. It's absent on Arch Linux, which follows a rolling-release model and uses the BUILD_ID field instead: BUILD_ID=rolling A subsequent commit will add built-in support for Arch Linux. Hence, the code to get the default release from the host operating system can no longer assume the presence of the VERSION_ID field in os-release(5). [1] https://www.freedesktop.org/software/systemd/man/os-release.html containers#1303
a6c2990 to
506836e
Compare
|
Build succeeded. ✔️ unit-test SUCCESS in 9m 26s |
| if err == nil { | ||
| if distroObj, supportedDistro := supportedDistros[hostID]; supportedDistro { | ||
| release, err := GetHostVersionID() | ||
| release, err := getDefaultReleaseForDistro(hostID) |
There was a problem hiding this comment.
We can't define releaseDefault in terms of an os-release(5) field like BUILD_ID (set to rolling) on Arch Linux. The arch-toolbox image is tagged with latest, not rolling, and there's nothing in os-release(5) that's set to latest. We really must stick to latest.
Time for another iteration.
The VERSION_ID field in os-release(5) is optional [1]. It's absent on Arch Linux, which follows a rolling-release model and uses the BUILD_ID field instead: BUILD_ID=rolling A subsequent commit will add built-in support for Arch Linux. Hence, the code to get the default release from the host operating system can no longer assume the presence of the VERSION_ID field in os-release(5). [1] https://www.freedesktop.org/software/systemd/man/os-release.html containers#1303
506836e to
a39d373
Compare
Operating system distributions like Arch Linux that follow a rolling-release model don't have the concept of a release. The latest snapshot is the only available release. A subsequent commit will add built-in support for Arch Linux. Hence, the code can no longer assume that every distribution will have a matching release. containers#1303
This allows using the --distro option to create and enter Arch Linux containers. Due to Arch's rolling-release model, the --release option isn't required. If --release is used, the accepted values are 'latest' and 'rolling'. containers#1303
|
Build succeeded. ✔️ unit-test SUCCESS in 9m 22s |
|
Build succeeded. ✔️ unit-test SUCCESS in 9m 18s |
|
Build succeeded. ✔️ unit-test SUCCESS in 9m 17s |
e951ddc to
b64e8c7
Compare
|
Build succeeded. ✔️ unit-test SUCCESS in 10m 23s |
The VERSION_ID field in os-release(5) is optional [1]. It's absent on Arch Linux, which follows a rolling-release model and uses the BUILD_ID field instead: BUILD_ID=rolling A subsequent commit will add built-in support for Arch Linux. Hence, the code to get the default release from the host operating system can no longer assume the presence of the VERSION_ID field in os-release(5). [1] https://www.freedesktop.org/software/systemd/man/os-release.html containers#1303
b64e8c7 to
5f5dbbf
Compare
|
Rebased on top of #1308 |
|
Build succeeded. ✔️ unit-test SUCCESS in 10m 56s |
The VERSION_ID field in os-release(5) is optional [1]. It's absent on Arch Linux, which follows a rolling-release model and uses the BUILD_ID field instead: BUILD_ID=rolling A subsequent commit will add built-in support for Arch Linux. Hence, the code to get the default release from the host operating system can no longer assume the presence of the VERSION_ID field in os-release(5). [1] https://www.freedesktop.org/software/systemd/man/os-release.html containers#1303
5f5dbbf to
c3ed234
Compare
|
Build succeeded. ✔️ unit-test SUCCESS in 9m 56s |
The VERSION_ID field in os-release(5) is optional [1]. It's absent on Arch Linux, which follows a rolling-release model and uses the BUILD_ID field instead: BUILD_ID=rolling A subsequent commit will add built-in support for Arch Linux. Hence, the code to get the default release from the host operating system can no longer assume the presence of the VERSION_ID field in os-release(5). Note that the arch-toolbox image is tagged with 'latest', in accordance with OCI conventions, not 'rolling' [2,3], which is the os-release(5) BUILD_ID. Therefore, it will be wise to use 'latest' as the default release on Arch Linux, to simplify how the default release matches with the default image's tag. This means that a os-release(5) field can't be used for the default release on Arch. [1] https://www.freedesktop.org/software/systemd/man/os-release.html [2] Commit 2568528 containers#861 [3] Commit a4e5861 containers#1308 containers#1303
c3ed234 to
774ce8b
Compare
|
Build succeeded. ✔️ unit-test SUCCESS in 9m 59s |
Operating system distributions like Arch Linux that follow a rolling-release model don't have the concept of a release. The latest snapshot is the only available release. A subsequent commit will add built-in support for Arch Linux. Hence, the code can no longer assume that every distribution will have a matching release. containers#1303
This allows using the --distro option to create and enter Arch Linux containers. Due to Arch's rolling-release model, the --release option isn't required. If --release is used, the accepted values are 'latest' and 'rolling'. containers#1303
The VERSION_ID field in os-release(5) is optional [1]. It's absent on Arch Linux, which follows a rolling-release model and uses the BUILD_ID field instead:
BUILD_ID=rolling
A subsequent commit will add built-in support for Arch Linux. Hence, the code to get the default release from the host operating system can no longer assume the presence of the VERSION_ID field in os-release(5).
[1] https://www.freedesktop.org/software/systemd/man/os-release.html