Skip to content

Commit

Permalink
SUP-3317 - Fix hosted agent attributes state mismatch (#872)
Browse files Browse the repository at this point in the history
* Reset hostedAgentResourceModel struct on Update before setting nested attributes

* Store plan value in state so tests can pass
  • Loading branch information
petetomasik authored Feb 5, 2025
1 parent cf86a0d commit a9473c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion buildkite/resource_cluster_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,9 @@ func (cq *clusterQueueResource) Update(ctx context.Context, req resource.UpdateR
state.Description = types.StringPointerValue(r.ClusterQueueUpdate.ClusterQueue.Description)
state.DispatchPaused = types.BoolValue(r.ClusterQueueUpdate.ClusterQueue.DispatchPaused)
if state.HostedAgents != nil {
state.HostedAgents.InstanceShape = types.StringValue(string(r.ClusterQueueUpdate.ClusterQueue.HostedAgents.InstanceShape.Name))
state.HostedAgents = &hostedAgentResourceModel{
InstanceShape: types.StringValue(string(r.ClusterQueueUpdate.ClusterQueue.HostedAgents.InstanceShape.Name)),
}
if plan.HostedAgents.Mac != nil {
state.HostedAgents.Mac = &macConfigModel{
XcodeVersion: types.StringValue(r.ClusterQueueUpdate.ClusterQueue.HostedAgents.PlatformSettings.Macos.XcodeVersion),
Expand Down

0 comments on commit a9473c2

Please sign in to comment.