From 117c84ee2d8da1dc6b9ad064a026fc54975a84b4 Mon Sep 17 00:00:00 2001 From: Stanislav Filin Date: Thu, 13 Jul 2023 13:32:28 +0000 Subject: [PATCH] docker stack config environment variable merge is not as expected Signed-off-by: Stanislav Filin --- cli/compose/loader/merge.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/compose/loader/merge.go b/cli/compose/loader/merge.go index e72b6d5e30..b48d3452b9 100644 --- a/cli/compose/loader/merge.go +++ b/cli/compose/loader/merge.go @@ -126,7 +126,9 @@ func toServiceVolumeConfigsMap(s interface{}) (map[interface{}]interface{}, erro } m := map[interface{}]interface{}{} for _, v := range volumes { - m[v.Target] = v + if _, exists := m[v.Target]; !exists { + m[v.Target] = v + } } return m, nil }