Skip to content

Commit bbae4b8

Browse files
authored
Merge pull request #1193 from hashicorp/brandonc/IPL-5516-tfe_compatibility
Fixes older TFE, tfe_workspace_settings always unsets execution_mode
2 parents c1b44b4 + d8e2c87 commit bbae4b8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
BUG FIXES:
44
* Fixed default provider organization usage for `r/tfe_admin_organization_settings`, by @brandonc [1183](https://github.com/hashicorp/terraform-provider-tfe/pull/1183)
5+
* `/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)
56

67
# v0.51.0
78

internal/provider/resource_tfe_workspace_settings.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,11 @@ func (m unknownIfExecutionModeUnset) PlanModifyString(ctx context.Context, req p
166166
if configured.ExecutionMode.IsNull() && overwritesState[0].ExecutionMode.ValueBool() {
167167
resp.PlanValue = types.StringUnknown()
168168
}
169-
} else if req.Path.Equal(path.Root("execution_mode")) {
169+
} else if configured.ExecutionMode.IsNull() && req.Path.Equal(path.Root("execution_mode")) {
170170
// TFE does not support overwrites so default the execution mode to "remote"
171171
resp.PlanValue = types.StringValue("remote")
172+
} else if configured.AgentPoolID.IsNull() && req.Path.Equal(path.Root("agent_pool_id")) {
173+
resp.PlanValue = types.StringNull()
172174
}
173175
}
174176

0 commit comments

Comments
 (0)