Skip to content

Commit 97c49fc

Browse files
committed
normalize volume.target to drop trailing slash
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent fb8e04d commit 97c49fc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

loader/normalize.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package loader
1818

1919
import (
2020
"fmt"
21+
"path"
2122
"strconv"
2223
"strings"
2324

@@ -102,6 +103,17 @@ func Normalize(dict map[string]any, env types.Mapping) (map[string]any, error) {
102103
}
103104
}
104105

106+
if v, ok := service["volumes"]; ok {
107+
volumes := v.([]any)
108+
for i, volume := range volumes {
109+
vol := volume.(map[string]any)
110+
target := vol["target"].(string)
111+
vol["target"] = path.Clean(target)
112+
volumes[i] = vol
113+
}
114+
service["volumes"] = volumes
115+
}
116+
105117
if n, ok := service["volumes_from"]; ok {
106118
volumesFrom := n.([]any)
107119
for _, v := range volumesFrom {

0 commit comments

Comments
 (0)