Describe the bug
under projects -> version control -> branch settings there are 2 fields for settings Default Branch and Protected branch patterns
If these 2 fields are set to the same thing, and you try to use data resource octopusdeploy_projects, you get the below error output in terraform
Error: Duplicate Set Element
data "octopusdeploy_projects" "all" {}
Steps to reproduce
- under projects -> version control -> branch settings, set
Default Branch and Protected branch patterns to "main"
- setup a terraform repo locally, and in main.tf add this data block
data "octopusdeploy_projects" "all" {}
- run terraform apply
- See error
╷
│ Error: Duplicate Set Element
│
│ with data.octopusdeploy_projects.nall,
│ This attribute contains duplicate values of: tftypes.String<"main">
Expected behavior
Terraform apply from above examples cleanly applys
Logs and other supporting information
╷
│ Error: Duplicate Set Element
│
│ with data.octopusdeploy_projects.nall,
│ This attribute contains duplicate values of: tftypes.String<"main">
Environment and versions:
- OS:
OSX
- Octopus Server Version: newest cloud version
- Terraform Version: v1.5.7
- Octopus Terraform Provider Version: latest main line or "0.7.63"
Additional context
I ran a debug session and was able to track it down to this line of code that was causing the error.