From 2cbd0f1b8865f0e272b1d7f4d4c0c322f987fc96 Mon Sep 17 00:00:00 2001 From: Austin Abro <37223396+AustinAbro321@users.noreply.github.com> Date: Thu, 23 Jan 2025 12:18:39 -0500 Subject: [PATCH] fix: transform set variables to uppercase in dev inspect definition (#3428) Signed-off-by: Austin Abro --- src/cmd/dev.go | 3 +++ src/test/e2e/00_use_cli_test.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cmd/dev.go b/src/cmd/dev.go index 640a9db7bc..8bc41c2109 100644 --- a/src/cmd/dev.go +++ b/src/cmd/dev.go @@ -89,6 +89,9 @@ func newDevInspectDefinitionCommand(v *viper.Viper) *cobra.Command { func (o *devInspectDefinitionOptions) run(cmd *cobra.Command, args []string) error { ctx := cmd.Context() + v := getViper() + o.setVariables = helpers.TransformAndMergeMap( + v.GetStringMapString(VPkgCreateSet), o.setVariables, strings.ToUpper) pkg, err := layout2.LoadPackage(ctx, setBaseDirectory(args), o.flavor, o.setVariables) if err != nil { return err diff --git a/src/test/e2e/00_use_cli_test.go b/src/test/e2e/00_use_cli_test.go index 88b6fbd9d6..5a52da6110 100644 --- a/src/test/e2e/00_use_cli_test.go +++ b/src/test/e2e/00_use_cli_test.go @@ -25,7 +25,7 @@ func TestUseCLI(t *testing.T) { t.Parallel() pathToPackage := filepath.Join("src", "test", "packages", "00-dev-inspect-definition") - stdOut, _, err := e2e.Zarf(t, "dev", "inspect", "definition", pathToPackage, "--flavor=ice-cream", "--set=MY_VAR=worked-as-expected", "--architecture=amd64") + stdOut, _, err := e2e.Zarf(t, "dev", "inspect", "definition", pathToPackage, "--flavor=ice-cream", "--set=my_var=worked-as-expected", "--architecture=amd64") require.NoError(t, err) b, err := os.ReadFile(filepath.Join(pathToPackage, "expected-zarf.yaml")) require.NoError(t, err)