Skip to content

Commit

Permalink
Merge pull request #814 from runatlantis/logging
Browse files Browse the repository at this point in the history
Log output of failed terraform workspace new cmd
  • Loading branch information
lkysow authored Oct 26, 2019
2 parents fed2f59 + e56f14a commit 6ade4ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/events/runtime/plan_step_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,10 @@ func (p *PlanStepRunner) switchWorkspace(ctx models.ProjectCommandContext, path
if err != nil {
// If terraform workspace select fails we run terraform workspace
// new to create a new workspace automatically.
_, err = p.TerraformExecutor.RunCommandWithVersion(ctx.Log, path, []string{workspaceCmd, "new", "-no-color", ctx.Workspace}, envs, tfVersion, ctx.Workspace)
return err
out, err := p.TerraformExecutor.RunCommandWithVersion(ctx.Log, path, []string{workspaceCmd, "new", "-no-color", ctx.Workspace}, envs, tfVersion, ctx.Workspace)
if err != nil {
return fmt.Errorf("%s: %s", err, out)
}
}
return nil
}
Expand Down

0 comments on commit 6ade4ba

Please sign in to comment.