Skip to content

Commit a863776

Browse files
authored
feat: added mixed cluster mode (#1042)
* mixed mode implementation * fixed typo on 24.04 Ubuntu Minimal version
1 parent ca3e66f commit a863776

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

modules/workers/locals.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,16 +298,16 @@ locals {
298298
"22.04" = "jammy"
299299
"24.04" = "noble"
300300
"22.04 Minimal" = "jammy"
301-
"24.04 Minimal" = "nobble"
301+
"24.04 Minimal" = "noble"
302302
}
303303

304304
ubuntu_worker_pools = {
305305
for k, v in local.enabled_worker_pools : k => {
306306
kubernetes_major_version = substr(lookup(v, "kubernetes_version", ""), 1, 4)
307307
kubernetes_minor_version = substr(lookup(v, "kubernetes_version", ""), 1, -1)
308-
ubuntu_release = lookup(data.oci_core_image.workers[k], "operating_system_version", null) != null ? lookup(data.oci_core_image.workers[k], "operating_system_version") : lookup(v, "os_version", null)
308+
ubuntu_release = lookup(lookup(data.oci_core_image.workers, k, {}), "operating_system_version", null) != null ? lookup(lookup(data.oci_core_image.workers, k, {}), "operating_system_version") : lookup(v, "os_version", null)
309309
}
310310
if lookup(v, "mode", var.worker_pool_mode) != "virtual-node-pool" &&
311-
contains(coalescelist(split(" ", lookup(data.oci_core_image.workers[k], "operating_system", "")), [lookup(v, "os", "")]), "Ubuntu")
311+
contains(coalescelist(split(" ", lookup(lookup(data.oci_core_image.workers, k, {}), "operating_system", "")), [lookup(v, "os", "")]), "Ubuntu")
312312
}
313313
}

modules/workers/virtualnodepools.tf

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,8 @@ resource "oci_containerengine_virtual_node_pool" "workers" {
8080
}
8181

8282
precondition {
83-
condition = contains(["Pod.Standard.E3.Flex", "Pod.Standard.E4.Flex"], each.value.shape)
84-
error_message = "Virtual Node Pools must be 'Pod.Standard.E3.Flex' or 'Pod.Standard.E4.Flex'."
85-
}
86-
87-
precondition {
88-
condition = length(local.enabled_modes) == 1
89-
error_message = format(
90-
"Mixed mode cluster is not allowed: %#v. Virtual and provisioned node pools cannot be created in the same cluster.",
91-
local.enabled_modes
92-
)
83+
condition = contains(["Pod.Standard.E3.Flex", "Pod.Standard.E4.Flex", "Pod.Standard.A1.Flex"], each.value.shape)
84+
error_message = "Virtual Node Pools must be 'Pod.Standard.E3.Flex', 'Pod.Standard.E4.Flex' or 'Pod.Standard.A1.Flex'."
9385
}
9486
}
9587
}

0 commit comments

Comments
 (0)