From d0ef8666390b1a88e91a7b98c9fbc43242676457 Mon Sep 17 00:00:00 2001 From: Matthew Hooker Date: Thu, 12 Jan 2017 16:08:54 -0800 Subject: [PATCH] don't interpolate atlas variables. --- command/push.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/command/push.go b/command/push.go index c92bdd3d2..9394d4fe8 100644 --- a/command/push.go +++ b/command/push.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/atlas-go/archive" "github.com/hashicorp/atlas-go/v1" + "github.com/mitchellh/packer/helper/flag-kv" "github.com/mitchellh/packer/template" ) @@ -189,7 +190,15 @@ func (c *PushCommand) Run(args []string) int { } // Collect the variables from CLI args and any var files - uploadOpts.Vars = core.Context().UserVariables + uploadOpts.Vars = make(map[string]string) + if vs := flags.Lookup("var"); vs != nil { + f := vs.Value.(*kvflag.Flag) + vars := map[string]string(*f) + + for k, v := range vars { + uploadOpts.Vars[k] = v + } + } // Add the upload metadata metadata := make(map[string]interface{})