Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/util/helpers_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ func getOSVersion(osReleasePath string) (string, error) {
return getDebianVersion(osReleaseMap), nil
case "azurelinux":
return getDebianVersion(osReleaseMap), nil
case "flatcar":
return getDebianVersion(osReleaseMap), nil
default:
return "", fmt.Errorf("Unsupported ID in /etc/os-release: %q", osReleaseMap["ID"])
}
Expand Down
6 changes: 6 additions & 0 deletions pkg/util/helpers_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ func TestGetOSVersionLinux(t *testing.T) {
expectedOSVersion: "azurelinux 3.0.20240328",
expectErr: false,
},
{
name: "flatcar",
fakeOSReleasePath: "testdata/os-release-flatcar",
expectedOSVersion: "flatcar 4372.0.1",
expectErr: false,
},
{
name: "Unknown",
fakeOSReleasePath: "testdata/os-release-unknown",
Expand Down
13 changes: 13 additions & 0 deletions pkg/util/testdata/os-release-flatcar
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
NAME="Flatcar Container Linux by Kinvolk"
ID=flatcar
ID_LIKE=coreos
VERSION=4372.0.1
VERSION_ID=4372.0.1
BUILD_ID=2025-07-06-2244
SYSEXT_LEVEL=1.0
PRETTY_NAME="Flatcar Container Linux by Kinvolk 4372.0.1 (Oklo)"
ANSI_COLOR="38;5;75"
HOME_URL="https://flatcar.org/"
BUG_REPORT_URL="https://issues.flatcar.org"
FLATCAR_BOARD="amd64-usr"
CPE_NAME="cpe:2.3:o:flatcar-linux:flatcar_linux:4372.0.1:*:*:*:*:*:*:*"