From 7b13306909191258aa76f63c145ee5087039a81c Mon Sep 17 00:00:00 2001 From: Jacob McCann Date: Fri, 12 May 2017 10:06:54 -0500 Subject: [PATCH] Allow multiple backend-config options --- plugin.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugin.go b/plugin.go index 739aae1..c230135 100644 --- a/plugin.go +++ b/plugin.go @@ -31,9 +31,9 @@ type ( } InitOptions struct { - BackendConfig string `json:"backend-config"` - Lock *bool `json:"lock"` - LockTimeout string `json:"lock-timeout"` + BackendConfig []string `json:"backend-config"` + Lock *bool `json:"lock"` + LockTimeout string `json:"lock-timeout"` } Plugin struct { @@ -122,8 +122,9 @@ func initCommand(config InitOptions) *exec.Cmd { "init", } - if config.BackendConfig != "" { - args = append(args, fmt.Sprintf("-backend-config=%s", config.BackendConfig)) + fmt.Printf("config.BackendConfig: %v\n", config.BackendConfig) + for _, v := range config.BackendConfig { + args = append(args, fmt.Sprintf("-backend-config=%s", v)) } // True is default in TF