Skip to content

Commit

Permalink
Fix logic error
Browse files Browse the repository at this point in the history
  • Loading branch information
itaispiegel committed Sep 13, 2024
1 parent f0b528e commit 17d6086
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions octopusdeploy/data_source_worker_pools.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ func dataSourceWorkerPoolsRead(ctx context.Context, d *schema.ResourceData, m in
return diag.FromErr(err)
}

// Octopus currently doesn't support filtering by name, so we have to do it ourselves
if name != "" && workerPoolResource.Name == name {
flattenedWorkerPools = append(flattenedWorkerPools, flattenWorkerPool(workerPoolResource))
// There is no name filter on the WorkerPools endpoint in the Octopus API,
// so filter in-memory if the name field is specified
if name != "" && workerPoolResource.Name != name {
continue
}
flattenedWorkerPools = append(flattenedWorkerPools, flattenWorkerPool(workerPoolResource))
}

d.Set("worker_pools", flattenedWorkerPools)
Expand Down

0 comments on commit 17d6086

Please sign in to comment.