terraform-provider-octopusdeploy
terraform-provider-octopusdeploy copied to clipboard
Data Sources that use is_disabled aren't able to list only false values
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
- Configure Octopus with a disabled Deployment Target
- Create a data source for a deployment target using the
is_disabledfield set to false:
data "octopusdeploy_polling_tentacle_deployment_targets" "targets" {
is_disabled = false
}
- 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
This appears to be a bug in the API.
For my current test setup:
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