Skip to content
Open
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 @@ -72,6 +72,8 @@ func getOSVersion(osReleasePath string) (string, error) {
return getDebianVersion(osReleaseMap), nil
case "flatcar":
return getDebianVersion(osReleaseMap), nil
case "azurecontainerlinux":
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 @@ -100,6 +100,12 @@ func TestGetOSVersionLinux(t *testing.T) {
expectedOSVersion: "flatcar 4372.0.1",
expectErr: false,
},
{
name: "azurecontainerlinux",
fakeOSReleasePath: "testdata/os-release-acl",
expectedOSVersion: "azurecontainerlinux 3.0.20260311",
expectErr: false,
},
{
name: "Unknown",
fakeOSReleasePath: "testdata/os-release-unknown",
Expand Down
14 changes: 14 additions & 0 deletions pkg/util/testdata/os-release-acl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
NAME="Microsoft Azure Container Linux"
ID=azurecontainerlinux
ID_LIKE=azurelinux
VERSION=3.0.20260311
VERSION_ID=3.0.20260311
BUILD_ID=053024-b84c192057-dirty
SYSEXT_LEVEL=1.0
PRETTY_NAME="Microsoft Azure Container Linux 3.0.20260311+053024-b84c192057-dirty"
ANSI_COLOR="1;34"
HOME_URL="https://aka.ms/azurelinux"
BUG_REPORT_URL="https://aka.ms/azurelinux"
SUPPORT_URL="https://aka.ms/azurelinux"
FLATCAR_BOARD="amd64-usr"
CPE_NAME="cpe:2.3:o:microsoft:azure_container_linux:3.0.20260311+053024-b84c192057-dirty:*:*:*:*:*:*:*"