Skip to content

Commit

Permalink
Merge pull request #1205 from hashicorp/fix/validate-agent-execution
Browse files Browse the repository at this point in the history
Local PR for #1204
  • Loading branch information
brandonc committed Jan 4, 2024
2 parents e8838d2 + 76ee5b7 commit 2859317
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/provider/resource_tfe_workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -903,9 +903,9 @@ func validateAgentExecution(_ context.Context, d *schema.ResourceDiff) error {
if executionModeSet {
executionModeIsAgent := executionMode.AsString() == "agent"
if executionModeIsAgent && !agentPoolIDSet {
return fmt.Errorf("execution_mode must be set to 'agent' to assign agent_pool_id")
} else if !executionModeIsAgent && agentPoolIDSet {
return fmt.Errorf("agent_pool_id must be provided when execution_mode is 'agent'")
} else if !executionModeIsAgent && agentPoolIDSet {
return fmt.Errorf("execution_mode must be set to 'agent' to assign agent_pool_id")
}
}

Expand Down

0 comments on commit 2859317

Please sign in to comment.