Skip to content

Commit

Permalink
Merge pull request #16620 from rifelpet/rocky9
Browse files Browse the repository at this point in the history
Add support for Rocky 9
  • Loading branch information
k8s-ci-robot authored Jun 15, 2024
2 parents bb995c2 + e5244af commit 5befa3f
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 1 deletion.
15 changes: 15 additions & 0 deletions docs/operations/images.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ The following table provides the support status for various distros with regards
| [RHEL 8](#rhel-8) | 1.15 | 1.18 | - | - |
| [RHEL 9](#rhel-9) | 1.27 | - | - | - |
| [Rocky 8](#rocky-8) | 1.23.2 | 1.24 | - | - |
| [Rocky 9](#rocky-9) | 1.30 | - | - | - |
| Ubuntu 16.04 | 1.5 | 1.10 | 1.17 | 1.20 |
| Ubuntu 18.04 | 1.10 | 1.16 | 1.26 | 1.28 |
| [Ubuntu 20.04](#ubuntu-2004-focal) | 1.16.2 | 1.18 | - | - |
Expand Down Expand Up @@ -209,6 +210,20 @@ aws ec2 describe-images --region us-east-1 --output table \
--filters "Name=name,Values=Rocky-8-ec2-8.*.*"
```

### Rocky 9

Rocky Linux 9 is based on Kernel version **5.14**.

Available images can be listed using:

```bash
aws ec2 describe-images --region us-east-1 --output table \
--owners 792107900819 \
--query "sort_by(Images, &CreationDate)[*].[CreationDate,Name,ImageId]" \
--filters "Name=name,Values=Rocky-9-EC2-Base-9.*.*"
```


### Ubuntu 20.04 (Focal)

Ubuntu 20.04 is based on Kernel version **5.4** which fixes all the known major Kernel bugs.
Expand Down
7 changes: 6 additions & 1 deletion upup/pkg/fi/nodeup/nodetasks/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"os/exec"
"path"
"reflect"
"slices"
"strings"
"sync"

Expand Down Expand Up @@ -326,7 +327,11 @@ func (_ *Package) RenderLocal(t *local.LocalTarget, a, e, changes *Package) erro
args = []string{"apt-get", "install", "--yes", "--no-install-recommends"}
env = append(env, "DEBIAN_FRONTEND=noninteractive")
} else if d.IsRHELFamily() {
if d == distributions.DistributionRhel8 || d == distributions.DistributionRocky8 || d == distributions.DistributionRhel9 {

if slices.Contains([]distributions.Distribution{
distributions.DistributionRhel8, distributions.DistributionRocky8,
distributions.DistributionRhel9, distributions.DistributionRocky9,
}, d) {
args = []string{"/usr/bin/dnf", "install", "-y", "--setopt=install_weak_deps=False"}
} else {
args = []string{"/usr/bin/yum", "install", "-y"}
Expand Down
1 change: 1 addition & 0 deletions util/pkg/distributions/distributions.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var (
DistributionRhel8 = Distribution{packageFormat: "rpm", project: "rhel", id: "rhel8", version: 8}
DistributionRhel9 = Distribution{packageFormat: "rpm", project: "rhel", id: "rhel9", version: 9}
DistributionRocky8 = Distribution{packageFormat: "rpm", project: "rocky", id: "rocky8", version: 8}
DistributionRocky9 = Distribution{packageFormat: "rpm", project: "rocky", id: "rocky9", version: 9}
DistributionFlatcar = Distribution{packageFormat: "", project: "flatcar", id: "flatcar", version: 0}
DistributionContainerOS = Distribution{packageFormat: "", project: "containeros", id: "containeros", version: 0}
)
Expand Down
3 changes: 3 additions & 0 deletions util/pkg/distributions/identify.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ func FindDistribution(rootfs string) (Distribution, error) {
if strings.HasPrefix(distro, "rocky-8.") {
return DistributionRocky8, nil
}
if strings.HasPrefix(distro, "rocky-9.") {
return DistributionRocky9, nil
}

// Some distros are not supported
klog.V(2).Infof("Contents of /etc/os-release:\n%s", osReleaseBytes)
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 @@ -109,6 +109,11 @@ func TestFindDistribution(t *testing.T) {
err: nil,
expected: DistributionRocky8,
},
{
rootfs: "rocky9",
err: nil,
expected: DistributionRocky9,
},
{
rootfs: "ubuntu1604",
err: fmt.Errorf("unsupported distro: ubuntu-16.04"),
Expand Down
17 changes: 17 additions & 0 deletions util/pkg/distributions/tests/rocky9/etc/os-release
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
NAME="Rocky Linux"
VERSION="9.4 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.4"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.4 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.4"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.4"

0 comments on commit 5befa3f

Please sign in to comment.