@@ -57,46 +57,38 @@ data "helm_template" "cluster_autoscaler" {
5757 for path in var . cluster_autoscaler_helm_values_files : file (path)
5858 ] : null
5959
60- set {
61- name = " nodeSelector.oke\\ .oraclecloud\\ .com/cluster_autoscaler"
62- value = " allowed"
63- }
64-
65- dynamic "set" {
66- for_each = merge (local. cluster_autoscaler_defaults , var. cluster_autoscaler_helm_values )
67- iterator = helm_value
68- content {
69- name = helm_value. key
70- value = helm_value. value
71- }
72- }
73-
74- dynamic "set" {
75- for_each = local. worker_pools_autoscaling
76- iterator = pool
77- content {
78- name = " autoscalingGroups[${ index (keys (local. worker_pools_autoscaling ), pool. key )} ].name"
79- value = lookup (pool. value , " id" )
80- }
81- }
82-
83- dynamic "set" {
84- for_each = local. worker_pools_autoscaling
85- iterator = pool
86- content {
87- name = " autoscalingGroups[${ index (keys (local. worker_pools_autoscaling ), pool. key )} ].minSize"
88- value = lookup (pool. value , " min_size" , lookup (pool. value , " size" ))
89- }
90- }
91-
92- dynamic "set" {
93- for_each = local. worker_pools_autoscaling
94- iterator = pool
95- content {
96- name = " autoscalingGroups[${ index (keys (local. worker_pools_autoscaling ), pool. key )} ].maxSize"
97- value = lookup (pool. value , " max_size" , lookup (pool. value , " size" ))
98- }
99- }
60+ set = concat (
61+ [
62+ {
63+ name = " nodeSelector.oke\\ .oraclecloud\\ .com/cluster_autoscaler"
64+ value = " allowed"
65+ }
66+ ],
67+ [ for k , v in merge (local. cluster_autoscaler_defaults , var. cluster_autoscaler_helm_values ) :
68+ {
69+ name = k,
70+ value = v
71+ }
72+ ],
73+ [ for k , v in local . worker_pools_autoscaling :
74+ {
75+ name = " autoscalingGroups[${ index (keys (local. worker_pools_autoscaling ), k)} ].name" ,
76+ value = lookup (v, " id" )
77+ }
78+ ],
79+ [ for k , v in local . worker_pools_autoscaling :
80+ {
81+ name = " autoscalingGroups[${ index (keys (local. worker_pools_autoscaling ), k)} ].minSize" ,
82+ value = lookup (v, " min_size" , lookup (v, " size" ))
83+ }
84+ ],
85+ [ for k , v in local . worker_pools_autoscaling :
86+ {
87+ name = " autoscalingGroups[${ index (keys (local. worker_pools_autoscaling ), k)} ].maxSize" ,
88+ value = lookup (v, " max_size" , lookup (v, " size" ))
89+ }
90+ ],
91+ )
10092
10193 lifecycle {
10294 precondition {
@@ -136,6 +128,8 @@ resource "null_resource" "cluster_autoscaler" {
136128 }
137129
138130 provisioner "remote-exec" {
139- inline = [" kubectl apply -f ${ local . cluster_autoscaler_manifest_path } " ]
131+ inline = [
132+ " kubectl apply -f ${ local . cluster_autoscaler_manifest_path } "
133+ ]
140134 }
141135}
0 commit comments