Skip to content

Commit 524f677

Browse files
authored
Added support for Ubuntu Minimal versions (#1031)
* Added support for Ubuntu Minimal versions
1 parent 0339491 commit 524f677

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

modules/workers/cloudinit.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ data "cloudinit_config" "workers" {
106106
apt = {
107107
sources = {
108108
oke-node = {
109-
source = format("deb [trusted=yes] https://objectstorage.us-sanjose-1.oraclecloud.com/p/45eOeErEDZqPGiymXZwpeebCNb5lnwzkcQIhtVf6iOF44eet_efdePaF7T8agNYq/n/odx-oke/b/okn-repositories-private/o/prod/ubuntu-%s/kubernetes-%s stable main",
110-
lookup(lookup(local.ubuntu_worker_pools, each.key, {}), "ubuntu_release", "22.04") == "22.04" ? "jammy" : "noble",
109+
source = format("deb [trusted=yes] https://odx-oke.objectstorage.us-sanjose-1.oci.customer-oci.com/n/odx-oke/b/okn-repositories/o/prod/ubuntu-%s/kubernetes-%s stable main",
110+
length(regexall( "22\\.04", lookup(lookup(local.ubuntu_worker_pools, each.key, {}), "ubuntu_release", "22.04"))) > 0 ? "jammy" : "noble",
111111
lookup(lookup(local.ubuntu_worker_pools, each.key, {}), "kubernetes_major_version", ""))
112112
}
113113
}
@@ -184,7 +184,7 @@ data "cloudinit_config" "workers" {
184184
precondition {
185185
condition = lookup(local.ubuntu_worker_pools, each.key, null) == null || (
186186
lookup(local.ubuntu_worker_pools, each.key, null) != null &&
187-
contains(["22.04", "24.04"], lookup(lookup(local.ubuntu_worker_pools, each.key, {}), "ubuntu_release", ""))
187+
contains(local.ubuntu_supported_versions, lookup(lookup(local.ubuntu_worker_pools, each.key, {}), "ubuntu_release", ""))
188188
)
189189
error_message = <<-EOT
190190
Supported Ubuntu versions are "22.04" and "24.04".

modules/workers/locals.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,9 @@ locals {
292292
worker_pool_ips = merge(local.worker_instance_ips, local.worker_nodepool_ips)
293293

294294
# Map of nodepools using Ubuntu images.
295+
296+
ubuntu_supported_versions = ["22.04", "24.04", "22.04 Minimal", "24.04 Minimal"]
297+
295298
ubuntu_worker_pools = {
296299
for k, v in local.enabled_worker_pools : k => {
297300
kubernetes_major_version = substr(lookup(v, "kubernetes_version", ""), 1, 4)

0 commit comments

Comments
 (0)