From 68bae2b66608809f6dfed041465d1ffbeb9a021f Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Mon, 8 Jan 2024 13:15:39 -0600 Subject: [PATCH] fix: don't break on --substitute values which have commas (#580) 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 5ab577a0..566ba286 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 63258c7d..c7841090 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 <