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

Inconsistent conditional result types error in net-vpc module #1335

Merged
merged 1 commit into from
Apr 18, 2023

Conversation

jamesmao-xyz
Copy link
Contributor

The conditional statement, with tomap({}) will cause the following error under terraform 1.4.5

Error: Inconsistent conditional result types

│ on ../../../modules/net-vpc/subnets.tf line 20, in locals:
│ 20: _factory_data = var.data_folder == null ? tomap({}) : {
│ 21: for f in fileset(var.data_folder, "**/*.yaml") :
│ 22: trimsuffix(basename(f), ".yaml") => yamldecode(file("${var.data_folder}/${f}"))
│ 23: }
│ ├────────────────
│ │ var.data_folder is "data/subnets/common"

│ The false result value has the wrong type: element types must all match for conversion to map.

The conditional statement, with tomap({}) will cause the following error under terraform 1.4.5

Error: Inconsistent conditional result types
│ 
│   on ../../../modules/net-vpc/subnets.tf line 20, in locals:
│   20:   _factory_data = var.data_folder == null ? tomap({}) : {
│   21:     for f in fileset(var.data_folder, "**/*.yaml") :
│   22:     trimsuffix(basename(f), ".yaml") => yamldecode(file("${var.data_folder}/${f}"))
│   23:   }
│     ├────────────────
│     │ var.data_folder is "data/subnets/common"
│ 
│ The false result value has the wrong type: element types must all match for conversion to map.
@ludoo ludoo changed the title Fix the tf error: Inconsistent conditional result types Inconsistent conditional result types error in net-vpc module Apr 18, 2023
@ludoo
Copy link
Collaborator

ludoo commented Apr 18, 2023

Thanks for the fix, looks good!

@juliocc juliocc merged commit 66f0090 into GoogleCloudPlatform:master Apr 18, 2023
@jamesmao-xyz jamesmao-xyz deleted the patch-1 branch April 18, 2023 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants