cleaning unnecessary codee

This commit is contained in:
pierre geeraert
2026-10-11 23:31:01 +01:00
parent 4620270006
commit d720f66322
3 changed files with 11 additions and 11 deletions
+7 -7
View File
@@ -46,7 +46,7 @@ resource "kubernetes_deployment_v1" "automatic" {
for_each = each.value.pvc != null ? each.value.pvc : {}
content {
mount_path = volume_mount.value.mount_path
name = "${volume_mount.value.name}-pvc"
name = "${volume_mount.key}-volume"
sub_path = volume_mount.value.sub_path != null ? volume_mount.value.sub_path : ""
}
}
@@ -189,27 +189,27 @@ resource "kubernetes_deployment_v1" "automatic" {
dynamic "volume" {
for_each = each.value.pvc != null ? each.value.pvc : {}
content {
name = "${volume.value.name}-pvc"
name = "${volume.key}-volume"
dynamic "config_map" {
for_each = volume.value.config_map ? [1] : []
content {
name = volume.value.name
name = volume.key
}
}
dynamic "host_path" {
for_each = volume.value.host_path != null || volume.value.local_path ? [1] : []
for_each = volume.value.host_path != null || (!(volume.value.config_map) && !(volume.value.secret)) ? [1] : []
content {
path = coalesce(volume.value.host_path, join("/", [var.storage_path.main_storage, coalesce(each.value.namespace, each.value.connected_namespace, each.key), coalesce(each.value.name, each.key)]))
path = coalesce(volume.value.host_path, join("/", [var.storage_path.main_storage, coalesce(each.value.namespace, each.value.connected_namespace, each.key), volume.key]))
}
}
dynamic "secret" {
for_each = volume.value.secret ? [1] : []
content {
secret_name = volume.value.name
secret_name = volume.key
}
}