From 65b947d52ffe4961ce04022accd6610d34fb4e28 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 16 Jun 2022 11:38:38 +0200 Subject: [PATCH] Fix for state_push: path for statefile is reqired for run state push cmd --- tfexec/state_push.go | 2 ++ tfexec/state_push_test.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tfexec/state_push.go b/tfexec/state_push.go index 98f50f15..14e55a2e 100644 --- a/tfexec/state_push.go +++ b/tfexec/state_push.go @@ -61,5 +61,7 @@ func (tf *Terraform) statePushCmd(ctx context.Context, path string, opts ...Stat args = append(args, "-lock-timeout="+c.lockTimeout) } + args = append(args, path) + return tf.buildTerraformCmd(ctx, nil, args...), nil } diff --git a/tfexec/state_push_test.go b/tfexec/state_push_test.go index 3c3250ed..075c33a2 100644 --- a/tfexec/state_push_test.go +++ b/tfexec/state_push_test.go @@ -26,6 +26,7 @@ func TestStatePushCmd(t *testing.T) { "push", "-lock=false", "-lock-timeout=0s", + "testpath", }, nil, statePushCmd) }) @@ -41,6 +42,7 @@ func TestStatePushCmd(t *testing.T) { "-force", "-lock=true", "-lock-timeout=10s", + "testpath", }, nil, statePushCmd) }) }