Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
FinnianDempsey opened this issue Apr 4, 2024 · 1 comment
Labels
category/api Issues related to API issues. kind/bug Something isn't working

Comments

@FinnianDempsey
Copy link

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

@benPearce1
Copy link
Collaborator

benPearce1 commented Jul 18, 2024

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 OctopusDeploy/Issues#8916

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category/api Issues related to API issues. kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants