From 7f4af7c3913f3956425f67d739bb87bcf93bc406 Mon Sep 17 00:00:00 2001 From: Paul Tyng Date: Mon, 13 Jul 2020 16:34:04 -0400 Subject: [PATCH] Add missing `=` --- tfexec/import.go | 2 +- tfexec/import_test.go | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/tfexec/import.go b/tfexec/import.go index 4071d986..9caf605b 100644 --- a/tfexec/import.go +++ b/tfexec/import.go @@ -95,7 +95,7 @@ func (tf *Terraform) importCmd(ctx context.Context, address, id string, opts ... args = append(args, "-backup="+c.backup) } if c.config != "" { - args = append(args, "-config"+c.config) + args = append(args, "-config="+c.config) } if c.lockTimeout != "" { args = append(args, "-lock-timeout="+c.lockTimeout) diff --git a/tfexec/import_test.go b/tfexec/import_test.go index 460acb2e..801d5b3b 100644 --- a/tfexec/import_test.go +++ b/tfexec/import_test.go @@ -16,7 +16,7 @@ func TestImport(t *testing.T) { ctx := context.Background() for _, tfv := range []string{ - // "0.11.14", doesn't support show JSON output, but does support import + "0.11.14", // doesn't support show JSON output, but does support import "0.12.28", "0.13.0-beta3", } { @@ -39,11 +39,17 @@ func TestImport(t *testing.T) { t.Fatal(err) } - err = tf.Import(ctx, resourceAddress, expectedID, DisableBackup(), Lock(false)) + // Config is unnecessary here since its already the working dir, but just testing an additional flag + err = tf.Import(ctx, resourceAddress, expectedID, DisableBackup(), Lock(false), Config(td)) if err != nil { t.Fatal(err) } + if strings.HasPrefix(tfv, "0.11.") { + t.Logf("skipping state assertion for 0.11") + return + } + state, err := tf.StateShow(ctx) if err != nil { t.Fatal(err)