diff --git a/command/meta.go b/command/meta.go index b469ecb5e8..1a6ca47f45 100644 --- a/command/meta.go +++ b/command/meta.go @@ -190,7 +190,7 @@ func (m *Meta) InputMode() terraform.InputMode { var mode terraform.InputMode mode |= terraform.InputModeProvider - if len(m.variables) == 0 && m.autoKey == "" { + if len(m.variables) == 0 { mode |= terraform.InputModeVar mode |= terraform.InputModeVarUnset } diff --git a/command/meta_test.go b/command/meta_test.go index bb3b34107d..23b817203a 100644 --- a/command/meta_test.go +++ b/command/meta_test.go @@ -158,7 +158,7 @@ func TestMetaInputMode_defaultVars(t *testing.T) { t.Fatalf("err: %s", err) } - if m.InputMode()&terraform.InputModeVar != 0 { + if m.InputMode()&terraform.InputModeVar == 0 { t.Fatalf("bad: %#v", m.InputMode()) } } diff --git a/command/push_test.go b/command/push_test.go index ccb7bc2229..96ed37d4e0 100644 --- a/command/push_test.go +++ b/command/push_test.go @@ -119,7 +119,7 @@ func TestPush_input(t *testing.T) { "foo": "foo", } if !reflect.DeepEqual(client.UpsertOptions.Variables, variables) { - t.Fatalf("bad: %#v", client.UpsertOptions) + t.Fatalf("bad: %#v", client.UpsertOptions.Variables) } }