File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
examples/container_engine Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -167,8 +167,8 @@ resource "oci_containerengine_node_pool" "test_node_pool" {
167167
168168 node_source_details {
169169 # Required
170- image_id = data . oci_containerengine_node_pool_option . test_node_pool_option . sources [ 0 ] . image_id
171- source_type = data . oci_containerengine_node_pool_option . test_node_pool_option . sources [ 0 ] . source_type
170+ image_id = local . oracle_linux_images . 0
171+ source_type = " IMAGE "
172172
173173 # Optional
174174 boot_volume_size_in_gbs = " 60"
@@ -234,6 +234,12 @@ data "oci_containerengine_node_pool_option" "test_node_pool_option" {
234234 node_pool_option_id = " all"
235235}
236236
237+ locals {
238+ all_sources = " ${ data . oci_containerengine_node_pool_option . test_node_pool_option . sources } "
239+
240+ oracle_linux_images = [for source in local . all_sources : source . image_id if length (regexall (" Oracle-Linux-[0-9]*.[0-9]*-20[0-9]*" ,source. source_name )) > 0 ]
241+ }
242+
237243output "cluster_kubernetes_versions" {
238244 value = [data . oci_containerengine_cluster_option . test_cluster_option . kubernetes_versions ]
239245}
Original file line number Diff line number Diff line change @@ -44,8 +44,8 @@ resource "oci_containerengine_node_pool" "test_node_pool" {
4444
4545 node_source_details {
4646 # Required
47- image_id = data . oci_containerengine_node_pool_option . test_node_pool_option . sources [ 0 ] . image_id
48- source_type = data . oci_containerengine_node_pool_option . test_node_pool_option . sources [ 0 ] . source_type
47+ image_id = local . oracle_linux_images . 0
48+ source_type = " IMAGE "
4949
5050 # Optional
5151 boot_volume_size_in_gbs = var. node_pool_boot_volume_size_in_gbs
Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ data "oci_containerengine_node_pool_option" "test_node_pool_option" {
1919 node_pool_option_id = " all"
2020}
2121
22+ locals {
23+ all_sources = " ${ data . oci_containerengine_node_pool_option . test_node_pool_option . sources } "
24+
25+ oracle_linux_images = [for source in local . all_sources : source . image_id if length (regexall (" Oracle-Linux-[0-9]*.[0-9]*-20[0-9]*" ,source. source_name )) > 0 ]
26+ }
27+
2228output "cluster_kubernetes_versions" {
2329 value = [data . oci_containerengine_cluster_option . test_cluster_option . kubernetes_versions ]
2430}
You can’t perform that action at this time.
0 commit comments