Skip to content

Commit

Permalink
Fixed invalid Terraform usage of claim_name.
Browse files Browse the repository at this point in the history
  • Loading branch information
BSick7 committed Mar 27, 2024
1 parent adb1f9d commit 0c05bb7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 0.6.10 (Mar 27, 2024)
* Fixed invalid Terraform usage of `claim_name`.

# 0.6.9 (Mar 27, 2024)
* Added support for `hostPath` volumes from capabilities.
* Fixed syntax for `persistentVolumeClaim` in k8s deployment.
Expand Down
2 changes: 1 addition & 1 deletion app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ locals {
service_account_email = google_service_account.app.email
service_name = local.service_name
service_port = local.service_port
internal_subdomain = var.port == 0 ? "" : "${local.block_name}.${local.kubernetes_namespace}.svc.cluster.local"
internal_subdomain = var.port == 0 ? "" : "${local.block_name}.${local.kubernetes_namespace}.svc.cluster.local"
})
}
4 changes: 2 additions & 2 deletions deployment.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ resource "kubernetes_deployment_v1" "this" {
for_each = local.volumes

content {
name = volume.key
name = volume.value.name

dynamic "empty_dir" {
for_each = volume.value.empty_dir == null ? [] : [1]
Expand All @@ -49,7 +49,7 @@ resource "kubernetes_deployment_v1" "this" {
iterator = pvc

content {
claim_name = pvc.claim_name
claim_name = lookup(pvc, "claim_name", "")
read_only = lookup(pvc, "read_only", null)
}
}
Expand Down
7 changes: 3 additions & 4 deletions volumes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ locals {
}
}

volumes = {
for v in local.cap_volumes : v.name =>
{
volumes = [
for v in local.cap_volumes : {
name = v.name
persistent_volume_claim = jsondecode(lookup(v, "persistent_volume_claim", "null"))
empty_dir = jsondecode(lookup(v, "empty_dir", "null"))
host_path = jsondecode(lookup(v, "host_path", "null"))
}
}
]
}

0 comments on commit 0c05bb7

Please sign in to comment.