Skip to content

Commit

Permalink
fix: var.cache could be null
Browse files Browse the repository at this point in the history
  • Loading branch information
MaciekLeks committed Dec 23, 2023
1 parent 8845d3a commit 3a0ebb3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ locals {
output_limit = ${var.output_limit}
unhealthy_requests_limit = ${var.unhealthy_requests_limit}
unhealthy_interval = "${var.unhealthy_interval}"
environment = ${jsonencode(local.job_envs)}
%{if var.cache.type == "local"~}
cache_dir = "${var.local_cache_dir}"
Expand Down
7 changes: 4 additions & 3 deletions local.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ locals {
// cond ? v1: v2 must be of the same type, to workaround this we use list: ["x", true][cond ? 0:1]
metrics = {
for k, v in var.metrics :
join("", [for i, kv in split("_", k) : i == 0 ? kv : title(kv)]) => [local.metrics_service_monitor, v][k == "service_monitor" ? 0 : 1]
join("", [for i, kv in split("_", k) : i == 0 ? kv : title(kv)]) =>
[local.metrics_service_monitor, v][k == "service_monitor" ? 0 : 1]
}

rbac_pod_security_policy = {
Expand Down Expand Up @@ -87,8 +88,8 @@ locals {
}
]

cache_gcs = {
cache_gcs = var.cache != null ? {
for k, v in var.cache.gcs : join("", [for i, kv in split("_", k) : title(kv)]) => v if v != null
}
} : null
}

0 comments on commit 3a0ebb3

Please sign in to comment.