fix: inconsistent types in conditional #2043
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Testing