terraform-provider-octopusdeploy icon indicating copy to clipboard operation
terraform-provider-octopusdeploy copied to clipboard

Data Sources that use is_disabled aren't able to list only false values

Open FinnianDempsey opened this issue 1 year ago • 1 comments

Describe the bug When using the TF provider with Data Sources for Deployment Targets, if using the is_disabled variable set to false, resources that are set to true are returned alongside false values

Steps to reproduce

  1. Configure Octopus with a disabled Deployment Target
  2. Create a data source for a deployment target using the is_disabled field set to false:
data "octopusdeploy_polling_tentacle_deployment_targets" "targets" {
    is_disabled = false
}
  1. Check terraform.tfstate file and see resources with is_disabled = true

Expected behavior Only false values should be returned when using is_disabled = false

Environment and versions:

  • Terraform Version: [e.g. 1.5.7]
  • Octopus Terraform Provider Version: [e.g. 0.18.1]

Additional context is_disabled = true works as expected which seems odd

FinnianDempsey avatar Apr 04 '24 06:04 FinnianDempsey

This appears to be a bug in the API.

For my current test setup: image

http://localhost:8066/api/Spaces-1/machines?skip=0&take=2147483647&isDisabled=false returns all six targets

{
  ItemType: "Machine",
  TotalResults: 6,
  ItemsPerPage: 2147483647,
  NumberOfPages: 1,
  LastPageNumber: 0,
  Items: [ ... ]
}

http://localhost:8066/api/Spaces-1/machines?skip=0&take=2147483647&isDisabled=true returns just the two disabled ones:

{
  ItemType: "Machine",
  TotalResults: 2,
  ItemsPerPage: 2147483647,
  NumberOfPages: 1,
  LastPageNumber: 0,
  Items: [ ... ]

Raised this as an issue against Server https://github.com/OctopusDeploy/Issues/issues/8916

benPearce1 avatar Jul 18 '24 00:07 benPearce1