reformat
This commit is contained in:
@@ -87,7 +87,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 : ""
|
||||
}
|
||||
}
|
||||
@@ -230,33 +230,27 @@ resource "kubernetes_deployment_v1" "automatic" {
|
||||
dynamic "volume" {
|
||||
for_each = each.value.pvc != null ? each.value.pvc : {}
|
||||
content {
|
||||
name = "${volume.value.name}-pvc"
|
||||
|
||||
dynamic "persistent_volume_claim" {
|
||||
for_each = volume.value.pvc ? [1] : []
|
||||
content {
|
||||
claim_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 ? [1] : []
|
||||
for_each = volume.value.host_path != null || (!(volume.value.config_map) && !(volume.value.secret)) ? [1] : []
|
||||
content {
|
||||
path = volume.value.host_path
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,8 +261,8 @@ resource "kubernetes_deployment_v1" "automatic" {
|
||||
content {
|
||||
name = "${each.key}-db-backup"
|
||||
|
||||
persistent_volume_claim {
|
||||
claim_name = "${each.key}-db-backup"
|
||||
host_path {
|
||||
path = join("/", [var.storage_path.fast_access, "Backup", coalesce(each.value.namespace, each.value.connected_namespace, each.key), "${each.key}-db-backup"])
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -276,5 +270,4 @@ resource "kubernetes_deployment_v1" "automatic" {
|
||||
}
|
||||
}
|
||||
}
|
||||
depends_on = [kubernetes_persistent_volume_claim_v1.automatic-pvc]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user