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
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ const PlatformBottlerocket = "bottlerocket"
// PlatformAlpine uses Ohai identifier for alpine platform
const PlatformAlpine = "alpine"

// PlatformChainguard uses Ohai identifier for chainguard platform
const PlatformChainguard = "chainguard"

// PlatformWolfi uses Ohai identifier for wolfi platform
const PlatformWolfi = "wolfi"

// PlatformSuse uses Ohai identifier for suse platform
const PlatformSuse = "suse"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ func parseOSreleaseFile(lines []string) (string, string, error) {
if strings.Contains(strings.ToLower(name), "leap") {
platform = c.PlatformOpensuseLeap
}
case "chainguard":
platform = c.PlatformChainguard
case "wolfi":
platform = c.PlatformWolfi
}

return platform, platformVersion, nil
Expand Down Expand Up @@ -412,7 +416,7 @@ func platformFamilyForPlatform(platform string) (string, error) {
return c.PlatformFamilyRhel, nil
case c.PlatformFedora:
return c.PlatformFamilyFedora, nil
case c.PlatformAlpine:
case c.PlatformAlpine, c.PlatformChainguard, c.PlatformWolfi:
return c.PlatformFamilyAlpine, nil
case c.PlatformSuse, c.PlatformOpensuse, c.PlatformOpensuseLeap:
return c.PlatformFamilySuse, nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,14 @@ func TestParseOSreleaseFile(t *testing.T) {
[]string{`NAME="Alpine Linux"`, `ID=alpine`, `VERSION_ID=3.5.0`, `PRETTY_NAME="Alpine Linux v3.5"`, `HOME_URL="http://alpinelinux.org"`, `BUG_REPORT_URL="http://bugs.alpinelinux.org"`},
"alpine", "3.5.0", false,
},
{
[]string{`NAME="Chainguard"`, `ID=chainguard`, `VERSION_ID=20230214`, `PRETTY_NAME="Chainguard"`, `HOME_URL="https://chainguard.dev"`},
"chainguard", "20230214", false,
},
{
[]string{`NAME="Wolfi"`, `ID=wolfi`, `VERSION_ID=20230201`, `PRETTY_NAME="Wolfi"`, `HOME_URL="https://wolfi.dev"`, `BUG_REPORT_URL="https://github.com/wolfi-dev/os/issues"`},
"wolfi", "20230201", false,
},
{
[]string{`NAME="CentOS Linux"`, `VERSION="7 (Core)"`, `ID="centos"`, `ID_LIKE="rhel fedora"`, `VERSION_ID="7"`, `PRETTY_NAME="CentOS Linux 7 (Core)"`, `ANSI_COLOR="0;31"`, `CPE_NAME="cpe:/o:centos:centos:7"`, `HOME_URL="https://www.centos.org/"`, `BUG_REPORT_URL="https://bugs.centos.org/"`, `CENTOS_MANTISBT_PROJECT="CentOS-7"`, `CENTOS_MANTISBT_PROJECT_VERSION="7"`, `REDHAT_SUPPORT_PRODUCT="centos"`, `REDHAT_SUPPORT_PRODUCT_VERSION="7"`},
"centos", "7", false,
Expand Down