Skip to content
Draft
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
6 changes: 6 additions & 0 deletions controllers/object_controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,12 @@ func kernelFullVersion(n ClusterPolicyController) (string, string, string) {
if !ok {
return kFVersion, "", ""
}

if osName == "rocky" {
// If the OS is RockyLinux, we will omit the RockyLinux minor version when constructing the os image tag
osVersion = strings.Split(osVersion, ".")[0]
}

osTag := fmt.Sprintf("%s%s", osName, osVersion)

return kFVersion, osTag, osVersion
Expand Down
5 changes: 5 additions & 0 deletions internal/state/nodepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"fmt"
"maps"
"strings"

corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand Down Expand Up @@ -132,5 +133,9 @@ func getNodePools(ctx context.Context, k8sClient client.Client, selector map[str
}

func (n nodePool) getOS() string {
if n.osRelease == "rocky" {
// If the OS is RockyLinux, we will omit the RockyLinux minor version when constructing the os image tag
n.osVersion = strings.Split(n.osRelease, ".")[0]
}
return fmt.Sprintf("%s%s", n.osRelease, n.osVersion)
}