Skip to content

Commit

Permalink
feat: add warning when creating a cluster queue with "dispatch_paused…
Browse files Browse the repository at this point in the history
… = true"

Signed-off-by: Tom Watt <[email protected]>
  • Loading branch information
tomowatt committed Dec 16, 2024
1 parent 314091e commit 519c521
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion buildkite/resource_cluster_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,15 @@ func (cq *clusterQueueResource) Create(ctx context.Context, req resource.CreateR
state.ClusterUuid = types.StringValue(r.ClusterQueueCreate.ClusterQueue.Cluster.Uuid)
state.Key = types.StringValue(r.ClusterQueueCreate.ClusterQueue.Key)
state.Description = types.StringPointerValue(r.ClusterQueueCreate.ClusterQueue.Description)
state.DispatchPaused = plan.DispatchPaused

// GraphQL API does not allow Cluster Queue to be created with Dispatch Paused
if plan.DispatchPaused.ValueBool() {
resp.Diagnostics.AddWarning(
"Cluster Queue cannot be created with Dispatch Paused",
"Setting dispatch_paused in State to 'true' but requires re-run of Apply",
)
}
state.DispatchPaused = plan.DispatchPaused
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
}

Expand Down

0 comments on commit 519c521

Please sign in to comment.