From d9cb119d495bed8513077e9572483483631a0839 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Fri, 5 Jan 2024 15:05:27 -0600 Subject: [PATCH] fix: don't break on --substitute values which have commas The following: stacker build --substitute a=b,c used to work, until commit 3baba644: fix(ci): convert ci is failing due to perms (#439) This squashed PR included 'chore(go.mod): update cli to github.com/urfave/cli/v2'. Switching from urfave/cli/v1 to v2 changes string slice flag behavior to automatically split on commas. Luckily there is an app.DisableSliceFlagSeparator flag we can set to tell it not to do that. Set that flag. And add a test for this. Signed-off-by: Serge Hallyn --- cmd/stacker/main.go | 2 ++ test/basic.bats | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/cmd/stacker/main.go b/cmd/stacker/main.go index 5ab577a06..566ba2866 100644 --- a/cmd/stacker/main.go +++ b/cmd/stacker/main.go @@ -123,6 +123,8 @@ func main() { &checkCmd, } + app.DisableSliceFlagSeparator = true + app.Flags = []cli.Flag{ &cli.StringFlag{ Name: "work-dir", diff --git a/test/basic.bats b/test/basic.bats index 63258c7d3..c7841090a 100644 --- a/test/basic.bats +++ b/test/basic.bats @@ -304,3 +304,15 @@ EOF [ ! -f dest/rootfs/favicon.ico ] [ ! -d dest/rootfs/stacker ] } + +@test "commas in substitute flags ok" { + cat > stacker.yaml <