Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognize Ubuntu 21.10 (Impish Indri) #12300

Merged
merged 1 commit into from
Sep 11, 2021
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
1 change: 1 addition & 0 deletions util/pkg/distributions/distributions.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ var (
DistributionUbuntu2004 = Distribution{packageFormat: "deb", project: "ubuntu", id: "focal", version: 20.04}
DistributionUbuntu2010 = Distribution{packageFormat: "deb", project: "ubuntu", id: "groovy", version: 20.10}
DistributionUbuntu2104 = Distribution{packageFormat: "deb", project: "ubuntu", id: "hirsute", version: 21.04}
DistributionUbuntu2110 = Distribution{packageFormat: "deb", project: "ubuntu", id: "impish", version: 21.10}
DistributionAmazonLinux2 = Distribution{packageFormat: "rpm", project: "amazonlinux2", id: "amazonlinux2", version: 0}
DistributionRhel7 = Distribution{packageFormat: "rpm", project: "rhel", id: "rhel7", version: 7}
DistributionCentos7 = Distribution{packageFormat: "rpm", project: "centos", id: "centos7", version: 7}
Expand Down
2 changes: 2 additions & 0 deletions util/pkg/distributions/identify.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ func FindDistribution(rootfs string) (Distribution, error) {
return DistributionUbuntu2010, nil
case "ubuntu-21.04":
return DistributionUbuntu2104, nil
case "ubuntu-21.10":
return DistributionUbuntu2110, nil
}

// Some distros have a more verbose VERSION_ID
Expand Down
5 changes: 5 additions & 0 deletions util/pkg/distributions/identify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ func TestFindDistribution(t *testing.T) {
err: nil,
expected: DistributionUbuntu2104,
},
{
rootfs: "ubuntu2110",
err: nil,
expected: DistributionUbuntu2110,
},
{
rootfs: "notfound",
err: fmt.Errorf("reading /etc/os-release: open tests/notfound/etc/os-release: no such file or directory"),
Expand Down
12 changes: 12 additions & 0 deletions util/pkg/distributions/tests/ubuntu2110/etc/os-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PRETTY_NAME="Ubuntu Impish Indri"
NAME="Ubuntu"
VERSION_ID="21.10"
VERSION="21.10 (Impish Indri)"
VERSION_CODENAME=impish
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=impish