From 24d6623696611da3a5c33822e09216303e8cdf69 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Mon, 14 Oct 2024 11:51:13 +0200 Subject: [PATCH] normalize volume.target to drop trailing slash Signed-off-by: Nicolas De Loof --- loader/normalize.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/loader/normalize.go b/loader/normalize.go index e99b61b5..6e7fb71f 100644 --- a/loader/normalize.go +++ b/loader/normalize.go @@ -18,6 +18,7 @@ package loader import ( "fmt" + "path" "strconv" "strings" @@ -102,6 +103,17 @@ func Normalize(dict map[string]any, env types.Mapping) (map[string]any, error) { } } + if v, ok := service["volumes"]; ok { + volumes := v.([]any) + for i, volume := range volumes { + vol := volume.(map[string]any) + target := vol["target"].(string) + vol["target"] = path.Clean(target) + volumes[i] = vol + } + service["volumes"] = volumes + } + if n, ok := service["volumes_from"]; ok { volumesFrom := n.([]any) for _, v := range volumesFrom {