From c3a6f4996baee564fbe2e9a1e2ceb25920f85a9f Mon Sep 17 00:00:00 2001 From: Matthew Baggett <matthew@baggett.me> Date: Fri, 14 Feb 2025 21:49:08 +0100 Subject: [PATCH] :| --- docker/volume/locals.tf | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/docker/volume/locals.tf b/docker/volume/locals.tf index fbbb36f..746ae9a 100644 --- a/docker/volume/locals.tf +++ b/docker/volume/locals.tf @@ -7,11 +7,19 @@ locals { ]), 0, 63) is_bind = var.bind_path != null - driver_opts = coalesce(var.driver_opts, local.is_bind ? { - "type" = "none" - "device" = var.bind_path - "o" = "bind" - } : {}) + driver_opts = ( + var.driver_opts != {} + ? var.driver_opts + : ( + local.is_bind + ? { + "type" = "none" + "device" = var.bind_path + "o" = "bind" + } + : {} + ) + ) labels = merge(var.labels, { "com.docker.stack.namespace" = var.stack_name