Skip to content

Commit

Permalink
Merge pull request #1193 from hashicorp/brandonc/IPL-5516-tfe_compati…
Browse files Browse the repository at this point in the history
…bility

Fixes older TFE, tfe_workspace_settings always unsets execution_mode
  • Loading branch information
brandonc authored Dec 22, 2023
2 parents c1b44b4 + d8e2c87 commit bbae4b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

BUG FIXES:
* Fixed default provider organization usage for `r/tfe_admin_organization_settings`, by @brandonc [1183](https://github.com/hashicorp/terraform-provider-tfe/pull/1183)
* `/r/tfe_workspace_settings`: Fix compatibility with older versions of Terraform Enterprise when using agent execution by @brandonc [1193](https://github.com/hashicorp/terraform-provider-tfe/pull/1193)

# v0.51.0

Expand Down
4 changes: 3 additions & 1 deletion internal/provider/resource_tfe_workspace_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,11 @@ func (m unknownIfExecutionModeUnset) PlanModifyString(ctx context.Context, req p
if configured.ExecutionMode.IsNull() && overwritesState[0].ExecutionMode.ValueBool() {
resp.PlanValue = types.StringUnknown()
}
} else if req.Path.Equal(path.Root("execution_mode")) {
} else if configured.ExecutionMode.IsNull() && req.Path.Equal(path.Root("execution_mode")) {
// TFE does not support overwrites so default the execution mode to "remote"
resp.PlanValue = types.StringValue("remote")
} else if configured.AgentPoolID.IsNull() && req.Path.Equal(path.Root("agent_pool_id")) {
resp.PlanValue = types.StringNull()
}
}

Expand Down

0 comments on commit bbae4b8

Please sign in to comment.