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

fix: inconsistent types in conditional #2043

Conversation

sschne
Copy link
Contributor

@sschne sschne commented Jul 29, 2024

Issue-id

PR Checklist


Description

We are getting following error message when using private endpoints with webpubsub:

2024/07/29 06:57:53 Error: Inconsistent conditional result types 2024/07/29 06:57:53
2024/07/29 06:57:53 on /home/AzDevOps_azpcontainer/.terraform/modules/stage2/modules/messaging/web_pubsub/private_endpoint.tf line 11, in module "private_endpoint":
2024/07/29 06:57:53 11: private_dns = can(each.value.private_dns) ? var.remote_objects.private_dns : {}
2024/07/29 06:57:53 ├────────────────
2024/07/29 06:57:53 │ each.value.private_dns is object with 2 attributes
2024/07/29 06:57:53 │ var.remote_objects.private_dns is object with 5 attributes
2024/07/29 06:57:53
2024/07/29 06:57:53 The true and false result expressions must have consistent types. The 'true'
2024/07/29 06:57:53 value includes object attribute "devops", which is absent in the 'false'

We don't need the condition here, as the private_dns variable will only act as a resource reference and the decision making will be done by the var.settings.private_dns parameter

Does this introduce a breaking change

  • YES
  • NO

Testing

2024/07/29 06:57:53 Error: Inconsistent conditional result types
2024/07/29 06:57:53
2024/07/29 06:57:53   on /home/AzDevOps_azpcontainer/.terraform/modules/stage2/modules/messaging/web_pubsub/private_endpoint.tf line 11, in module "private_endpoint":
2024/07/29 06:57:53   11:   private_dns     = can(each.value.private_dns) ? var.remote_objects.private_dns : {}
2024/07/29 06:57:53     ├────────────────
2024/07/29 06:57:53     │ each.value.private_dns is object with 2 attributes
2024/07/29 06:57:53     │ var.remote_objects.private_dns is object with 5 attributes
2024/07/29 06:57:53
2024/07/29 06:57:53 The true and false result expressions must have consistent types. The 'true'
2024/07/29 06:57:53 value includes object attribute "devops", which is absent in the 'false'

We don't need the condition here, as the private_dns variable will only act as a resource reference and the decision making will be done by the var.settings.private_dns parameter
@arnaudlh arnaudlh added this to the 5.7.14 milestone Jul 31, 2024
@arnaudlh arnaudlh added the enhancement New feature or request label Jul 31, 2024
@arnaudlh arnaudlh merged commit 1bff9aa into aztfmod:main Jul 31, 2024
139 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants