diff --git a/pkg/util/helpers_linux.go b/pkg/util/helpers_linux.go index dbccf42db..8dd9f9019 100644 --- a/pkg/util/helpers_linux.go +++ b/pkg/util/helpers_linux.go @@ -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"]) } diff --git a/pkg/util/helpers_linux_test.go b/pkg/util/helpers_linux_test.go index eb6c99c61..a890c2154 100644 --- a/pkg/util/helpers_linux_test.go +++ b/pkg/util/helpers_linux_test.go @@ -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", diff --git a/pkg/util/testdata/os-release-acl b/pkg/util/testdata/os-release-acl new file mode 100644 index 000000000..e7a6a0b0c --- /dev/null +++ b/pkg/util/testdata/os-release-acl @@ -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:*:*:*:*:*:*:*" \ No newline at end of file