Skip to content

Commit

Permalink
Allow dynamic worker queue to be set
Browse files Browse the repository at this point in the history
  • Loading branch information
vandyliu committed Dec 16, 2024
1 parent c781538 commit ed060bf
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions internal/provider/resources/resource_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,20 +645,6 @@ func (r *DeploymentResource) ValidateConfig(
return
}

// Need to do dynamic validation based on the executor and worker queues
if data.Executor.ValueString() == string(platform.DeploymentExecutorKUBERNETES) && len(data.WorkerQueues.Elements()) > 0 {
resp.Diagnostics.AddError(
"worker_queues are not supported for 'KUBERNETES' executor",
"Either change the executor to 'CELERY' or remove worker_queues",
)
}
if data.Executor.ValueString() == string(platform.DeploymentExecutorCELERY) && (data.WorkerQueues.IsNull() || len(data.WorkerQueues.Elements()) == 0) {
resp.Diagnostics.AddError(
"worker_queues must be included for 'CELERY' executor",
"Either change the executor to 'KUBERNETES' or include worker_queues",
)
}

// Type specific validation
switch platform.DeploymentType(data.Type.ValueString()) {
case platform.DeploymentTypeSTANDARD:
Expand Down

0 comments on commit ed060bf

Please sign in to comment.