Skip to content

Commit cbaeb9f

Browse files
author
Mayank Singh
committed
add support for Azure Container Linux
Signed-off-by: Mayank Singh <mayansingh@microsoft.com>
1 parent 7aa0dbf commit cbaeb9f

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

pkg/util/helpers_linux.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ func getOSVersion(osReleasePath string) (string, error) {
7272
return getDebianVersion(osReleaseMap), nil
7373
case "flatcar":
7474
return getDebianVersion(osReleaseMap), nil
75+
case "acl":
76+
return getDebianVersion(osReleaseMap), nil
7577
default:
7678
return "", fmt.Errorf("unsupported ID in /etc/os-release: %q", osReleaseMap["ID"])
7779
}

pkg/util/helpers_linux_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ func TestGetOSVersionLinux(t *testing.T) {
100100
expectedOSVersion: "flatcar 4372.0.1",
101101
expectErr: false,
102102
},
103+
{
104+
name: "acl",
105+
fakeOSReleasePath: "testdata/os-release-acl",
106+
expectedOSVersion: "acl 4459.2.2",
107+
expectErr: false,
108+
},
103109
{
104110
name: "Unknown",
105111
fakeOSReleasePath: "testdata/os-release-unknown",

pkg/util/testdata/os-release-acl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
NAME="Azure Container Linux"
2+
ID=acl
3+
ID_LIKE=flatcar
4+
VERSION=4459.2.2
5+
VERSION_ID=4459.2.2
6+
BUILD_ID=97-g545e29b39d
7+
SYSEXT_LEVEL=1.0
8+
PRETTY_NAME="Azure Container Linux 4459.2.2+97-g545e29b39d (ACL)"
9+
ANSI_COLOR="38;5;75"
10+
HOME_URL="https://flatcar.org/"
11+
BUG_REPORT_URL="https://issues.flatcar.org"
12+
FLATCAR_BOARD="amd64-usr"
13+
CPE_NAME="cpe:2.3:o:acl-linux:acl_linux:4459.2.2+97-g545e29b39d:*:*:*:*:*:*:*"

0 commit comments

Comments
 (0)