Skip to content

Commit

Permalink
feat: 🎸 1/2 output plan to plan.out file
Browse files Browse the repository at this point in the history
  • Loading branch information
jaskaransarkaria committed Oct 3, 2024
1 parent 96bc8df commit 46baa9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/terraform/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ func (t *TerraformCLI) Plan(ctx context.Context, w io.Writer) (bool, error) {
t.Tf.SetStdout(w)
t.Tf.SetStderr(w)

outOptions := tfexec.Out("plan.out")
t.PlanVars = append(t.PlanVars, outOptions)
diff, err := t.Tf.Plan(ctx, t.PlanVars...)
if err != nil {
return false, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/terraform/terraform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func NewTestTerraformCLI(config *TerraformCLIConfig, tfMock *mocks.TerraformExec
m.On("Init", mock.Anything).Return(nil)
m.On("Apply", mock.Anything).Return(nil)
m.On("Destroy", mock.Anything).Return(nil)
m.On("Plan", mock.Anything).Return(true, nil)
m.On("Plan", mock.Anything, mock.Anything).Return(true, nil)
m.On("Output", mock.Anything).Return(nil, nil)
m.On("Show", mock.Anything).Return(nil, nil)
m.On("WorkspaceNew", mock.Anything, mock.Anything).Return(nil)
Expand Down

0 comments on commit 46baa9c

Please sign in to comment.