Skip to content

Commit

Permalink
Fix state management on updating the hosted_agents configuration of a…
Browse files Browse the repository at this point in the history
… cluster queue (#600)
  • Loading branch information
CerealBoy authored Dec 23, 2024
1 parent f37c128 commit ec7cd23
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@

## Unreleased

- Update golang.org/x/net [[PR #599](https://github.com/buildkite/terraform-provider-buildkite/pull/599)] @yob
- Fix state management on updating the hosted_agents configuration of a cluster queue [[PR #600](https://github.com/buildkite/terraform-provider-buildkite/pull/600)] @CerealBoy
- SUP-2591: add PlanModifiers when Hosted Agent attributes [[PR #598](https://github.com/buildkite/terraform-provider-buildkite/pull/598)] @tomowatt

## [v1.15.1]()

- SUP-2591: add PlanModifiers when Hosted Agent attributes [[PR #598](https://github.com/buildkite/terraform-provider-buildkite/pull/598)] @tomowatt
- Adding more examples for working with cluster queues [[PR #597](https://github.com/buildkite/terraform-provider-buildkite/pull/597)] @CerealBoy

## [v1.15.0]()

- Bump golang.org/x/crypto from 0.25.0 to 0.31.0 [[PR #594](https://github.com/buildkite/terraform-provider-buildkite/pull/594)] @dependabot
- SUP-2813: correct logic for pausing/resuming Dispatch on Queues and remove error with Default Cluster Queues [[PR #593](https://github.com/buildkite/terraform-provider-buildkite/pull/593)] @tomowatt
- Adding cluster queue support for hosted agents [[PR #596](https://github.com/buildkite/terraform-provider-buildkite/pull/596)] @CerealBoy
- Adding more examples for working with cluster queues [[PR #597](https://github.com/buildkite/terraform-provider-buildkite/pull/597)] @CerealBoy

## [v1.14.0](https://github.com/buildkite/terraform-provider-buildkite/compare/v1.13.1...v1.14.0)

Expand Down
12 changes: 8 additions & 4 deletions buildkite/resource_cluster_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,15 @@ func (cq *clusterQueueResource) Update(ctx context.Context, req resource.UpdateR
state.DispatchPaused = types.BoolValue(r.ClusterQueueUpdate.ClusterQueue.DispatchPaused)
if state.HostedAgents != nil {
state.HostedAgents.InstanceShape = types.StringValue(string(r.ClusterQueueUpdate.ClusterQueue.HostedAgents.InstanceShape.Name))
if state.HostedAgents.Mac != nil {
state.HostedAgents.Mac.XcodeVersion = types.StringValue(r.ClusterQueueUpdate.ClusterQueue.HostedAgents.PlatformSettings.Macos.XcodeVersion)
if plan.HostedAgents.Mac != nil {
state.HostedAgents.Mac = &macConfigModel{
XcodeVersion: types.StringValue(r.ClusterQueueUpdate.ClusterQueue.HostedAgents.PlatformSettings.Macos.XcodeVersion),
}
}
if state.HostedAgents.Linux != nil {
state.HostedAgents.Linux.ImageAgentRef = types.StringValue(r.ClusterQueueUpdate.ClusterQueue.HostedAgents.PlatformSettings.Linux.AgentImageRef)
if plan.HostedAgents.Linux != nil {
state.HostedAgents.Linux = &linuxConfigModel{
ImageAgentRef: types.StringValue(r.ClusterQueueUpdate.ClusterQueue.HostedAgents.PlatformSettings.Linux.AgentImageRef),
}
}
}

Expand Down

0 comments on commit ec7cd23

Please sign in to comment.