This commit is contained in:
Greyscale 2025-02-14 21:49:08 +01:00
parent ad6838a0be
commit c3a6f4996b
Signed by: grey
GPG key ID: DDB392AE64B32D89

View file

@ -7,11 +7,19 @@ locals {
]), 0, 63) ]), 0, 63)
is_bind = var.bind_path != null is_bind = var.bind_path != null
driver_opts = coalesce(var.driver_opts, local.is_bind ? { driver_opts = (
"type" = "none" var.driver_opts != {}
"device" = var.bind_path ? var.driver_opts
"o" = "bind" : (
} : {}) local.is_bind
? {
"type" = "none"
"device" = var.bind_path
"o" = "bind"
}
: {}
)
)
labels = merge(var.labels, { labels = merge(var.labels, {
"com.docker.stack.namespace" = var.stack_name "com.docker.stack.namespace" = var.stack_name